@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap");

/* ============================================================================
 * app-theme.css - Fusion de app.css (styles globaux customer+admin) et
 * admin-theme.css (surcharge visuelle admin Leroy Merlin Green).
 * Ordre de cascade preserve : app.css d'abord, puis admin-theme.css.
 * ========================================================================== */

:root {
  --primary: #78a22f;
  --primary-dark: #5f8226;
  --primary-soft: #f0f7e9;
  --bg: #f5f5f0;
  --card: #fff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --danger: #dc2626;
  --warning: #f59e0b;
  --blue: #2563eb;
  --purple: #7c3aed;
  --shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
code,
.code {
  font-family: Consolas, monospace;
  background: #111827;
  color: #d1fae5;
  padding: 2px 6px;
  border-radius: 5px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.btn:hover {
  background: var(--primary-dark);
  text-decoration: none;
}
.btn-outline,
.btn-outline-primary {
  background: #fff;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover,
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}
input,
select,
textarea {
  width: 100%;
  height: 42px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
textarea {
  height: auto;
  min-height: 90px;
}
label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  display: block;
  margin-bottom: 6px;
}

.block-order-detail {
  margin-top: 10px !important;
  background: transparent;
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
}
.notice-error,
.ui-alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ui-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}
.admin-logo {
  height: 40px;
  width: auto;
}
.customer-logo-img {
  height: 48px;
}
.footer-logo {
  height: 56px;
}
.auth-logo-img {
  height: 48px;
  width: auto;
}
/* Customer portal */
.customer-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.customer-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #d6e8bc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.customer-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.customer-main {
  flex: 1;
}
.customer-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 42px 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}
.headline-group h2 {
  font-size: 28px;
  font-weight: 400;
  color: var(--muted);
  margin: 0 0 4px;
}
.headline-group h1 {
  font-size: 54px;
  line-height: 1.05;
  font-weight: 300;
  margin: 0;
  color: #1f2937;
}
.customer-text {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 680px;
}
.customer-text strong {
  color: #111827;
}
.customer-info-card {
  display: flex;
  gap: 14px;
  background: #f3f7ef;
  border: 1px solid #dfead4;
  border-radius: 12px;
  padding: 22px;
  max-width: 760px;
  font-size: 13px;
}
.customer-info-card p {
  font-size: 13px;
}
.info-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: 0 0 auto;
}
.customer-search-form {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.customer-search-form input {
  height: 44px;
  font-size: 13px;
}
#otp-step > div {
  text-align: left;
}
.otp-inputs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.otp-inputs input {
  margin-bottom: 10px;
  width: 48px;
  min-width: 48px;
  height: 44px;
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  border-radius: 8px;
}
#otp-step .btn-outline-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
#otp-step .btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.customer-illustration {
  display: none;
  position: relative;
  height: 420px;
}

/* Order detail page styles */
.customer-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}
.customer-detail-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.customer-order-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.detail-block {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}
.detail-block h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--primary-dark);
}
.detail-list {
  margin: 0;
}
.detail-list dt {
  font-weight: 800;
  color: var(--muted);
  font-size: 12px;
}
.detail-list dd {
  margin: 6px 0 12px;
  color: var(--text);
}

/* Request summary card improvements */
/* remove duplicate side badge */
@media (min-width: 900px) {
}
@media (max-width: 900px) {
}

/* Green pane style for section headers like ORDER DETAILS */
.ui-card {
  padding: 0;
  border-radius: 12px;
  border: 1px solid #dfead4;
  overflow: hidden;
}
.ui-card + .ui-card {
  margin-top: 0px;
}
.ui-card-header.compact {
  background: linear-gradient(90deg, var(--primary-soft), #f3f7ef);
  padding: 14px 18px;
  border-bottom: 1px solid #dfead4;
  border-radius: 12px 12px 0 0;
  color: var(--primary-dark);
}
.ui-card .detail-section {
  padding: 18px;
}

/* Product details table tweaks */
.selectable-items .selectable-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
  margin-bottom: 8px;
}
.selectable-items .selectable-item.is-selected {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary-soft), #fff);
}
.selectable-items .selectable-item .select-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid #e5e7eb;
  flex: 0 0 auto;
}
.selectable-items .selectable-item.is-selected .select-box {
  background: var(--primary);
  border-color: var(--primary);
}

/* Action buttons */
.customer-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.customer-action-row .btn {
  border-radius: 8px;
  padding: 10px 18px;
}

/* Request form layout */
.action-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.action-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  min-height: 72px;
}
.action-choice-text {
  flex: 1;
}
.action-choice-text strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}
.action-choice-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.action-choice-control {
  flex: 0 0 48px;
  text-align: center;
}
.action-choice-control input[type="radio"] {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}

.request-form-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}
.request-form-grid label {
  font-weight: 700;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.request-form .detail-section textarea {
  min-height: 120px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .customer-order-summary-grid {
    grid-template-columns: 1fr;
  }
  .ui-card-header.compact {
    padding: 12px;
  }
  .customer-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .action-choice-grid {
    grid-template-columns: 1fr;
  }
  .request-form-grid {
    grid-template-columns: 1fr;
  }
}
.customer-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 0 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.customer-footer h3 {
  color: #111827;
  margin: 14px 0 8px;
  font-size: 13px;
}
@media (min-width: 960px) {
  .customer-hero {
    grid-template-columns: 1.15fr 0.85fr;
  }
  .customer-illustration {
    display: block;
  }
}
/* Auth */
.layout-auth {
  background: #e8ede3;
}
.auth-shell {
  min-height: 100vh;
  display: flex;
}
.auth-brand-panel {
  display: none;
  background: #5a7a3a;
  flex: 1;
}
.auth-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 35px rgba(31, 41, 55, 0.16);
  padding: 34px;
}
.auth-logo-wrap {
  margin-bottom: 22px;
}
.auth-title-block h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.auth-title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.auth-form {
  margin-top: 24px;
}
.auth-form input {
  height: 44px;
  margin-bottom: 16px;
}
.auth-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 2px 0 18px;
}
.auth-row .link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.auth-row .link-button.link-button--secondary {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
}
.auth-row .link-button.link-button--secondary:hover {
  color: var(--text);
  border-color: var(--muted);
  background: #f9fafb;
}
.auth-row .link-button.link-button--primary {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}
.auth-row .link-button.link-button--primary:hover {
  background: var(--primary);
  color: #fff;
}
.auth-row .link-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.auth-row .link-button svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.checkbox-label input {
  width: auto;
  height: auto;
  margin: 0;
}
.auth-actions {
  display: flex;
  justify-content: flex-end;
}
.auth-submit {
  padding-left: 24px;
  padding-right: 24px;
}
@media (min-width: 900px) {
  .auth-brand-panel {
    display: block;
  }
  .auth-card {
    padding: 38px;
  }
}
/* Center login card for admin login page */
.center-login .auth-brand-panel {
  display: none !important;
}
.center-login .auth-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
/* Admin Layout */
.admin-shell {
  min-height: 100vh;
  background: var(--bg);
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
}
.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
.admin-logo-link {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.admin-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.admin-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.admin-nav-item:hover {
  color: var(--primary);
  text-decoration: none;
}
.admin-nav-item.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.admin-tools {
  position: relative;
}
.admin-dropdown,
.profile-dropdown {
  position: absolute;
  top: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 16px 35px rgba(31, 41, 55, 0.14);
  z-index: 70;
  padding: 6px;
  min-width: 300px;
}
.admin-dropdown {
  left: 0;
}
.admin-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}
.admin-dropdown-item:hover,
.admin-dropdown-item.is-active {
  background: #f0fdf4;
  color: var(--primary);
  text-decoration: none;
}
.admin-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.avatar-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 0;
  border-radius: 10px;
  padding: 4px 8px;
  cursor: pointer;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.profile-dropdown {
  right: 7px;
  min-width: 290px;
}
.profile-dropdown a {
  display: block;
  padding: 10px 14px;
  color: #374151;
}
.profile-summary {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
}
.profile-summary strong,
.profile-summary small {
  display: block;
}
.profile-summary small {
  color: var(--muted);
  margin-top: 3px;
}
.logout-icon {
  border: 0;
  background: #fff;
  color: #6b7280;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.page-heading h1 {
  font-size: 26px;
  margin: 0 0 4px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.refresh-note {
  display: flex;
  gap: 6px;
  color: #9ca3af;
  font-size: 12px;
  align-items: center;
  margin-top: 10px;
}
.admin-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dashboard {
  margin: 0px;
}
  /* UI components */
.ui-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}
.ui-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #f3f4f6;
}
.ui-card-header.compact {
  padding: 16px 18px;
}
.ui-card-header h1,
.ui-card-header h2 {
  margin: 0;
  font-size: 18px;
  color: #1f2937;
}
.ui-card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.kpi-grid,
.summary-strip,
.request-kpi-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ui-kpi {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: 12px;
  padding: 14px;
}
.ui-kpi-warning {
  border-color: #fed7aa;
  background: #fff7ed;
}
.ui-kpi-critical {
  border-color: #fecaca;
  background: #fef2f2;
}
.ui-kpi-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.ui-kpi-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
}
.ui-kpi-value-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.ui-kpi-value {
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
  color: #111827;
}
.ui-delta {
  font-size: 12px;
  color: #16a34a;
  font-weight: 700;
}
.ui-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.ui-alert {
  border: 1px solid;
  border-radius: 12px;
  padding: 14px 16px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-left: 10px;margin-right: 10px;
}
.ui-table-wrap {
  overflow: auto;
}
.ui-table {
  width: 100%;
  border-collapse: collapse;
}
.ui-table th {
  background: #f9fafb;
  color: #6b7280;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ui-table th,
.ui-table td {
  padding: 6px 14px;
  border-bottom: 1px solid #f3f4f6;
  text-align: left;
  font-size: 13px;
}
.ui-table tr:hover td {
  background: #fafafa;
}
.ui-empty,
.empty-state {
  text-align: center;
  color: #9ca3af;
  padding: 24px !important;
}
.ui-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.ui-badge-type,
.ui-badge-status-web,
.ui-badge-status-return {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.ui-badge-status-pending,
.ui-badge-warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.ui-badge-status-manual-review,
.ui-badge-status-manual-review,
.ui-badge-status-pending-validation-by-finance {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fed7aa;
}
.ui-badge-status-approved,
.ui-badge-status-refunded,
.ui-badge-status-completed {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.ui-badge-status-rejected,
.ui-badge-status-cancelled {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
.ui-badge-status-captured {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}
.ui-badge-neutral {
  background: #f3f4f6;
  color: #374151;
}
.alert-list,
.event-list,
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}
.alert-item,
.event-item,
.task-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid #f3f4f6;
  background: #fff;
  border-radius: 10px;
  padding: 12px;
}
.alert-item {
  justify-content: space-between;
}
.event-item small,
.task-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.task-item {
  flex-direction: column;
  color: #111827;
}
.task-item:hover {
  text-decoration: none;
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.inline-form,
.filter-bar,
.search-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px 20px;
}
.filter-bar {
  border-top: 1px solid #f3f4f6;
}
.filter-bar > div {
  min-width: 160px;
}
.tab-row {
  display: flex;
  gap: 0;
}
.tab {
  padding: 10px 20px;
  border: 1px solid #d1d5db;
  border-bottom: 0;
  background: #fff;
  color: #4b5563;
  border-radius: 10px 10px 0 0;
  font-size: 13px;
  font-weight: 900;
}
.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.requests-layout {
  margin-left: 10px;
  margin-right: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.request-table-card {
  min-width: 0;
}
.summary-strip {
  background: linear-gradient(90deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 12px;
}
@media (min-width: 900px) {
  .dashboard-kpis,
  .summary-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .request-kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: 2fr 1fr;
  }
  .dashboard-grid.secondary {
    grid-template-columns: 1fr 1fr;
  }
  .requests-layout {
    grid-template-columns: 300px 1fr;
  }
}
@media (max-width: 900px) {
  .admin-topbar {
    align-items: flex-start;
  }
  .admin-topbar-left {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .admin-nav {
    font-size: 12px;
  }
  .admin-main {
    margin: 0px;
  }
  .customer-search-form {
    flex-direction: column;
  }
  .headline-group h1 {
    font-size: 40px;
  }
}

/* ============ ORDERS PAGE — reproduces Appian mockup ============ */
.orders-page {
  gap: 0;
}

/* Top dashboard banner */

/* ORDERS heading */
.orders-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.orders-heading-icon {
  display: inline-flex;
  color: #374151;
}
.orders-heading h1 {
  font-size: 26px;
  font-weight: 800;
  color: #1f2937;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.orders-count {
  font-size: 16px;
  color: #6b7280;
  font-weight: 600;
}
.orders-heading + .orders-card {
  border-top: 2px solid #cfe0be;
  margin-left: 10px;
  margin-right: 10px;
}

/* Filter bar (uniformisé : même gabarit compact que requests/tracking/customers/transactions,
   défini une seule fois dans mw-table.css .orders-filter-bar{padding:12px 18px}) */
/* Uniform font for all filter bar components */
.orders-filter-bar,
.orders-filter-bar input,
.orders-filter-bar select,
.orders-filter-bar button,
.orders-filter-bar .field-label,
.orders-filter-bar .field-value,
.orders-filter-bar .multi-select-button,
.orders-filter-bar .multi-select-row,
.orders-filter-bar .multi-select-row .label {
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.2;
}
.orders-filter-bar .orders-search {
  flex: 1 1 260px;
  min-width: 220px;
  margin-bottom: 0;
}
.orders-filter-bar .search-btn {
  flex: 0 0 auto;
  height: 44px;
  border-radius: 6px;
  color: var(--primary);
  background: #fff;
  font-weight: 800;
}
.orders-filter-bar .search-btn:hover {
  background: var(--primary);
  color: #fff;
}
.orders-search input {
  height: 44px;
  padding-left: 38px;
  border-radius: 6px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23888" viewBox="0 0 24 24"><path d="M21 20l-5.6-5.6a7 7 0 10-1.4 1.4L20 21l1-1zM4 11a7 7 0 1114 0A7 7 0 014 11z"/></svg>');
  background-repeat: no-repeat;
  background-position: 12px center;
}

/* Combined "label | value" select fields (STORE NAME, ORDER DATE, CHANNEL) */
.field-select,
.field-select-static {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  padding: 0 34px 0 14px;
  min-width: 200px;
  flex: 1 1 200px;
  cursor: pointer;
  text-align: left;
}
.field-select-static {
  gap: 10px;
}
.field-label {
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.field-value {
  color: #9ca3af;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 10px;
}
.field-select .caret,
.field-select-static .caret {
  position: absolute;
  right: 12px;
  color: #6b7280;
  pointer-events: none;
  font-size: 12px;
}
.field-date {
  border: 0 !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  color: #9ca3af;
  font-style: italic;
  flex: 1;
}
.orders-filter-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.icon-btn {
  width: 35px;
  height: 30px;
  padding: 0;
  color: #78a22f;
  border: #78a22f 1px solid;
  background: #fff;
}
.icon-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Multi-select store button styled as a field */
.store-multi-select {
  flex: 1 1 200px;
  min-width: 200px;
}
.store-multi-select .multi-select-button {
  width: 100%;
}

/* Table */
.orders-table {
  min-width: 1150px;
}
.orders-table th {
  background: #fff;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  padding: 14px 14px;
}
.orders-table td {
  padding: 16px 14px;
  border-bottom: 1px solid #f0f1ee;
  font-size: 14px;
  color: #374151;
  vertical-align: top;
}
.orders-table tr:hover td {
  background: #fbfdf8;
}
.help-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  margin-left: 3px;
  vertical-align: middle;
}
.cell-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted var(--primary);
}
.cell-link:hover {
  text-decoration: none;
  color: var(--primary-dark);
}
.name-link {
  font-weight: 700;
}

/* Badges */
.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 4px;
  background: #7cb342;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.channel-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.channel-web {
  background: #eaf3dd;
  color: #4f7a2a;
  border: 1px solid #c7e0a3;
}
.channel-mkp {
  background: #7cb342;
  color: #fff;
}

@media (max-width: 1100px) {
  .orders-heading {
  }
}

/* Multi-select dropdown */
.store-multi-select {
  position: relative;
}
/* Reusable multi-select filter widget (mw-filters.js) */
.mw-multiselect {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
}
.mw-multiselect .multi-select-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  height: 44px;
  white-space: nowrap;
  text-align: left;
  font-size: 13px;
}
.mw-multiselect .multi-select-button .caret {
  position: static;
  margin-left: 6px;
}
.mw-multiselect .multi-select-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: max-content;
  min-width: 100%;
  max-width: 360px;
  max-height: 280px;
  overflow: auto;
  z-index: 3000;
}
.mw-multiselect .multi-select-panel.open {
  display: block;
}
.mw-multiselect .field-value {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  margin-left: 0;
  font-size: 13px;
}
.mw-multiselect .field-value.has-value {
  color: #27402b;
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
}
.mw-multiselect .multi-select-row {
  padding: 6px 8px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
}
.mw-multiselect .multi-select-row .label {
  font-weight: 700;
  color: #27402b;
}
.mw-multiselect .multi-select-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.mw-multiselect .multi-select-empty {
  padding: 12px;
  color: #9ca3af;
  font-style: italic;
  text-align: center;
}
/* Users page: the store multi-select lives inside a scrollable
   .ui-table-wrap (overflow:auto) -- without this override the dropdown
   panel would be clipped by the table wrap instead of floating over it.
   The parent .ui-card also clips via overflow:hidden (used to round its
   corners), so it must be disabled too, with the radius moved onto the
   table wrap (last visible block of the card) -- same fix as
   .admin-shell .request-table-card below. */
.users-page .ui-card.users-table-card {
  overflow: visible;
}
/* Create User card: same overflow:hidden clipping issue as the table
   card above (see comment) -- the store multi-select added to this
   form needs its dropdown panel to float over the rest of the page. */
.users-page .ui-card.users-create-card {
  overflow: visible;
}
.users-page .ui-table-wrap {
  overflow: visible;
  border-radius: 0 0 var(--mt-radius-xl, 20px) var(--mt-radius-xl, 20px);
  position: relative;
  z-index: 0;
}
.users-page .filter-bar {
  position: relative;
  z-index: 5;
}

/* Users table: smaller font/padding + same fixed height for every
   inline control in a row (role select, store multi-select button,
   action buttons), so rows don't look bloated/misaligned. */
.users-page .ui-table th,
.users-page .ui-table td {
  font-size: 11px;
  padding: 6px 14px;
  line-height: 1.3;
}
.users-page .ui-table td select {
  height: 30px;
  padding: 2px 8px;
  font-size: 11px;
  vertical-align: middle;
}
.users-page .mw-multiselect .multi-select-button {
  height: 30px;
  min-width: 120px;
  padding: 0 8px;
  font-size: 11px;
}
.users-page .ui-table td .inline-form {
  align-items: center;
}
.users-page .ui-table td .btn,
.users-page .ui-table td .btn-outline {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* Create User form: same compact 11px sizing as the table below,
   including the store multi-select added to it. */
.users-page .users-create-card .filter-bar,
.users-page .users-create-card .filter-bar label,
.users-page .users-create-card .filter-bar input,
.users-page .users-create-card .filter-bar select {
  font-size: 11px;
}
.users-page .users-create-card .filter-bar input,
.users-page .users-create-card .filter-bar select {
  height: 30px;
  padding: 2px 8px;
}
.users-page .users-create-card .filter-bar .btn {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.users-page .users-create-card .mw-multiselect .multi-select-button {
  height: 30px;
  min-width: 120px;
  padding: 0 8px;
  font-size: 11px;
}
.multi-select-button {
  width: 220px;
  height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
}
.multi-select-panel {
  position: absolute;
  top: 48px;
  left: 0;
  width: 360px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
  z-index: 100;
  padding: 8px;
}
.multi-select-row {
  padding: 6px 8px;
  border-bottom: 1px solid #f3f4f6;
}
.multi-select-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Table layout tweaks to match maquette (uniformisé avec .orders-table : 13px, ligne compacte) */
.ui-table th {
  padding: 6px 14px;
  border-bottom: 2px solid #eef2e9;
}
.ui-table td {
  padding: 6px 14px;
}
.ui-table tr:hover td {
  background: #fbfff9;
}

/* Product detail table specifics */
.product-detail-table .col-select {
  width: 48px;
  text-align: center;
}
.product-detail-table .col-unit,
.product-detail-table .col-amt {
  white-space: nowrap;
  text-align: right;
}
.product-detail-table .selectable-row.is-selected td {
  background: linear-gradient(180deg, var(--primary-soft), #fff);
}
.product-detail-table .selectable-row.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}
.product-detail-table tbody tr td {
  vertical-align: middle;
}
.ui-empty {
  color: #8f9b7a;
}

/* Badge styles to green variants */
.ui-badge.type-simple {
  background: linear-gradient(180deg, #a7f3d0, #34d399);
  color: #065f46;
  border-color: transparent;
}
.ui-badge.type-split {
  background: linear-gradient(180deg, #bbf7d0, #34d399);
  color: #065f46;
  border-color: transparent;
}

/* KPI tiles look */
.summary-strip .ui-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eef6ea;
}
.summary-strip .ui-kpi .ui-kpi-value {
  font-size: 28px;
}
.summary-strip .ui-kpi .ui-kpi-icon svg {
  width: 44px;
  height: 44px;
}

.customer-copy {
  max-width: 600px;
  width: 100%;
  margin: auto;
  padding: 0 16px;
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .multi-select-panel {
    width: 100%;
  }
}

/* Center orders list view */
#order-detail-view {
  justify-content: center;
  padding: 18px 12px;
}
#order-detail-view .ui-card {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}
#order-detail-view .customer-detail-header {
  align-items: center;
}

#orders-list-view {
  display: flex;
  justify-content: center;
  padding: 18px 12px;
}
#orders-list-view .orders-card {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Remove frames / card borders on orders list */
#orders-list-view .orders-card {
  background: transparent;
  border: none;
  box-shadow: none;
}
#orders-list-view .orders-card .ui-table-wrap {
  background: transparent;
  border: none;
  padding: 0;
}
#orders-list-view .orders-card .ui-table {
  border-collapse: collapse;
}
#orders-list-view .orders-card .ui-table th,
#orders-list-view .orders-card .ui-table td {
  border-bottom: 1px solid #eef2e9;
  padding: 4px 12px;
  font-size: 11px;
}

/* Customer "Your orders" header — light-green bar, title left, email + Edit
   link right, aligned on the reference portal design. */
#orders-list-view .customer-orders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: #e8f8da;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
}
#orders-list-view .customer-orders-header-right {
  font-weight: 400;
}
#orders-list-view .customer-orders-edit-link {
  color: var(--primary-dark, #5c9219);
  font-weight: 800;
  text-decoration: underline;
  margin-left: 4px;
}

/* Info notice bar (light gray, rounded, black info bubble) */
#orders-list-view .customer-orders-info-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 18px 0;
  padding: 10px 14px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
#orders-list-view .customer-orders-info-notice p {
  margin: 0;
  color: #374151;
}
#orders-list-view .customer-orders-info-notice .info-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex: 0 0 auto;
}

/* Filter row: search + SEARCH button on the left, Order Date on the right */
#orders-list-view .customer-orders-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 18px;
}
#orders-list-view .customer-orders-filter-left,
#orders-list-view .customer-orders-filter-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
#orders-list-view .customer-orders-search-input {
  height: 38px;
  min-width: 180px;
  padding: 0 8px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  font-size: 13px;
}
#orders-list-view .customer-orders-search-btn {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.03em;
  cursor: pointer;
}
#orders-list-view .customer-orders-search-btn:hover {
  background: var(--primary);
  color: #fff;
}
#orders-list-view .customer-orders-date-label {
  font-size: 11px;
  font-weight: 700;
  color: #1f2937;
}
#orders-list-view .customer-orders-date-input {
  height: 38px;
  width: 150px;
  padding: 0 8px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  font-size: 13px;
  background: #fff;
}
#orders-list-view .customer-orders-date-btn {
  height: 38px;
  width: 38px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}

.orders-heading {
  margin-left: -10px !important;
  display: block;
}

/* Order type badge (WEB/APP = orange, MKP/MKS = green), matching the
   mockup's colored pills in the "Order Type" column. */
.customer-order-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 3px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.customer-order-type-badge.is-web {
  background: #ffa300;
}
.customer-order-type-badge.is-mkp {
  background: #78be20;
}
.customer-order-type-badge.is-default {
  background: #9ca3af;
}
#orders-list-view .orders-table .cell-amount {
  text-align: right;
}
#orders-list-view .orders-table th:nth-child(2) {
  text-align: right;
}
#orders-list-view .orders-table .customer-order-link {
  color: #1a73e8;
  font-weight: 600;
}
#orders-list-view .orders-table tbody tr:nth-child(even) {
  background: #f7f8f7;
}
#orders-list-view .orders-table tbody tr:hover {
  background: #eef7d8;
}

/* Compact "‹ 1 – 10 of 19 ›" pager (prev/next only) */
.customer-orders-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 18px;
  font-size: 13px;
  color: #1f2937;
}
.customer-orders-pagination .page-btn {
  border: none;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}
.customer-orders-pagination .page-btn:disabled {
  color: #c9d3bd;
  cursor: not-allowed;
}

/* Mobile-specific adjustments for sub-640px screens */
@media (max-width: 640px) {
  .customer-hero {
    padding: 24px 16px;
  }
  .headline-group h1 {
    font-size: 28px;
  }
  .headline-group h2 {
    font-size: 20px;
  }
  .customer-header-inner {
    padding: 0 12px;
  }
  .customer-footer {
    padding: 0 12px;
  }
  #orders-list-view .customer-orders-filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  #orders-list-view .customer-orders-filter-left,
  #orders-list-view .customer-orders-filter-right {
    flex-wrap: wrap;
  }
  #orders-list-view .customer-orders-search-input {
    min-width: 0;
    flex: 1;
  }
  #orders-list-view .customer-orders-date-input {
    flex: 1;
  }
  .customer-orders-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .customer-info-card {
    padding: 14px;
  }
}

/* Attachments table styles (admin request detail) */
.attachments-table th {
  background: #fff;
  color: #6b7280;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.attachments-table td {
  padding: 10px 12px;
  vertical-align: middle;
}
.attachments-table a {
  color: var(--primary);
  font-weight: 700;
}
.attachments-table .badge {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 6px;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
}
.attachments-table .file-link {
  color: var(--primary);
  font-weight: 700;
}
.attachments-table td img.attachment-thumb {
  height: 48px !important;
  width: 48px !important;
  border-radius: 6px;
  margin-right: 8px;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.06);
  cursor: pointer;
}
.attachments-table .badge-success {
  background: var(--primary-dark);
}

/* Image modal for attachment preview */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2147483647 !important;
  pointer-events: auto;
}
.image-modal.hidden {
  display: none;
}
.image-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 2147483646 !important;
}
.image-modal-content {
  position: relative;
  z-index: 2147483647 !important;
  max-width: 1100px;
  width: min(92%, 1100px);
  max-height: calc(100vh - 120px);
  padding: 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 40px 80px rgba(17, 24, 39, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-modal-content img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  border-radius: 8px;
  object-fit: contain;
}
.image-modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}

/* Feedback / Product Review modal ("Add Feedback" action on request-detail.php) */
.feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2147483647;
}
.feedback-modal.hidden {
  display: none;
}
.feedback-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 2147483646;
}
.feedback-modal-content {
  position: relative;
  z-index: 2147483647;
  max-width: 480px;
  width: min(92%, 480px);
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 40px 80px rgba(17, 24, 39, 0.6);
}
.feedback-modal-content h3 {
  margin: 0 0 16px;
  font-size: 18px;
}
.feedback-modal-content label {
  display: block;
  font-weight: 600;
  margin: 12px 0 4px;
}
.feedback-modal-content select,
.feedback-modal-content textarea {
  width: 100%;
  box-sizing: border-box;
}
.feedback-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

/* ===== Request detail — modernized styling ===== */
.request-detail-layout {
  gap: 32px;
  align-items: flex-start;
}
.request-main .ui-card {
  border-radius: 12px;
  padding: 0;
  overflow: visible;
}
.request-main .ui-card-header h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0f172a;
}
.request-sidebar .ui-card {
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
  border-radius: 12px;
}
.request-sidebar .customer-card {
  background: linear-gradient(180deg, #f7fbf0, #fff);
  border: 1px solid #e6f0d9;
  padding: 16px;
  border-radius: 10px;
}
.detail-list.compact dt {
  font-size: 12px;
  color: #6b7280;
  font-weight: 800;
}
.detail-list.compact dd {
  font-size: 14px;
  color: #111827;
  margin: 6px 0 12px;
}
.ui-table th {
  background: #fbfff8;
  color: #4b5563;
}
.ui-table td {
  font-size: 13px;
  color: #374151;
  padding: 6px 14px;
}
.attachments-table .badge {
  background: #10b981;
  color: #052e22;
}
.request-main section.ui-card {
  margin-bottom: 18px;
}
.page-heading h1 {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}
.page-heading p {
  color: #6b7280;
}
.attachments-table td img.attachment-thumb {
  border-radius: 8px;
}
.ui-table tr:hover td {
  background: #f7fff3;
}
.btn {
  transition: all 0.15s ease;
}
.ui-card {
  transition: box-shadow 0.18s ease;
}
.ui-card:hover {
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
}
/* Responsive */
@media (max-width: 900px) {
  .request-detail-layout {
    flex-direction: column;
  }
  .request-sidebar {
    width: 100%;
  }
  .page-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Shared customer-facing loading modal (window.CustomerLoader), used on every
   public-side page for full-page loads and button/form validations.
   Shown/hidden instantly (no fade) so it never lingers, semi-transparent,
   while the underlying page content is still being rendered/resized. */
.page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(2px);
}
.page-loading-overlay.hidden {
  display: none;
  pointer-events: none;
}
.page-loading-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.18);
  animation: page-loading-pop 0.18s ease-out;
  max-width: 320px;
  text-align: center;
}
.page-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid var(--primary-soft, #f0f7e9);
  border-top-color: var(--primary, #78a22f);
  animation: page-loading-spin 0.8s linear infinite;
}
.page-loading-text {
  margin: 0;
  color: var(--muted, #6b7280);
  font-weight: 600;
  font-size: 13px;
}
@keyframes page-loading-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes page-loading-pop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================================================
 * === Ancien admin-theme.css (surcharge admin) fusionne ci-dessous ===
 * ========================================================================== */

/* ============================================================================
 * Admin Theme Overlay — Leroy Merlin Green Edition
 * Refonte du design de la partie admin du portail Returns & Refunds.
 * Aligné visuellement sur portal-return-refund-app-V2 (tokens/police/flat
 * design repris de portal-return-refund-app-V2/css/style.css).
 * Chargé APRÈS app.css uniquement pour layoutMode = admin.
 * ============================================================================ */

:root {
  /* ===== Leroy Merlin green palette (brand #78BE20) ===== */
  --mt-green-50: #f3fae5;
  --mt-green-100: #e4f4c6;
  --mt-green-200: #cdea96;
  --mt-green-300: #b4df66;
  --mt-green-400: #98d23a;
  --mt-green-500: #78be20;
  --mt-green-600: #6aaa1c;
  --mt-green-700: #588f17;
  --mt-green-800: #467411;
  --mt-green-900: #355807;

  --mt-blue-50: #eff6ff;
  --mt-blue-100: #dbeafe;
  --mt-blue-500: #3b82f6;
  --mt-blue-600: #2563eb;
  --mt-blue-700: #1d4ed8;

  --mt-bg: #f7faf3;
  --mt-surface: #ffffff;
  --mt-text: #1f2937;
  --mt-muted: #6b7280;
  --mt-border: #e5e7eb;

  --mt-radius-sm: 6px;
  --mt-radius-md: 10px;
  --mt-radius-lg: 14px;
  --mt-radius-xl: 20px;

  --mt-shadow-sm:
    0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --mt-shadow-md:
    0 6px 16px -4px rgba(16, 24, 40, 0.08),
    0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --mt-shadow-lg:
    0 18px 32px -12px rgba(120, 190, 32, 0.22),
    0 4px 8px -2px rgba(16, 24, 40, 0.05);

  --mt-font:
    "Inter", "Nunito", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;

  /* Remap des variables historiques de app.css vers la charte LM */
  --primary: #78be20;
  --primary-dark: #588f17;
  --primary-soft: #f3fae5;
  --bg: #f7faf3;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --shadow:
    0 18px 32px -12px rgba(120, 190, 32, 0.22),
    0 4px 8px -2px rgba(16, 24, 40, 0.05);
}

/* --- Base --------------------------------------------------------------- */
body.layout-admin {
  font-family: var(--mt-font);
  background: var(--mt-bg);
  color: var(--mt-text);
  letter-spacing: -0.005em;
}
body.layout-admin a {
  color: var(--mt-green-700);
  transition: color 0.15s ease;
}
body.layout-admin a:hover {
  color: var(--mt-green-800);
}
body.layout-admin .muted {
  margin-left: 0;
}

/* --- Admin shell / topbar ---------------------------------------------- */
.admin-shell {
  background: var(--mt-bg);
}
.admin-topbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--mt-border);
  box-shadow: 0 1px 8px rgba(16, 24, 40, 0.04);
  padding: 8px 22px;
  position: sticky;
  top: 0;
  z-index: 1040;
}
.admin-nav-item {
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 12px;
  border-radius: var(--mt-radius-md);
  border-bottom: 2px solid transparent;
  gap: 7px;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.admin-nav-item:hover {
  color: var(--mt-green-700);
  background: var(--mt-green-50);
  text-decoration: none;
}
.admin-nav-item.is-active {
  color: var(--mt-green-800);
  background: var(--mt-green-50);
  border-bottom-color: var(--mt-green-500);
  font-weight: 700;
}
.admin-nav-item .ui-icon {
  font-size: 15px;
  opacity: 0.9;
}

/* Dropdowns (tools + profile) */
.admin-dropdown,
.profile-dropdown {
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-lg);
  box-shadow: var(--mt-shadow-md);
  padding: 6px;
}
.admin-dropdown-item {
  border-radius: var(--mt-radius-sm);
  font-weight: 600;
  gap: 9px;
}
.admin-dropdown-item:hover,
.admin-dropdown-item.is-active {
  background: var(--mt-green-50);
  color: var(--mt-green-700);
}
.profile-dropdown a:hover {
  background: var(--mt-green-50);
  color: var(--mt-green-700);
  text-decoration: none;
}

/* Avatar / logout */
.avatar {
  background: linear-gradient(135deg, var(--mt-green-500), var(--mt-green-600));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(86, 143, 23, 0.3);
}
.logout-icon {
  border-radius: var(--mt-radius-sm);
}
.logout-icon:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* --- Page heading ------------------------------------------------------- */
.page-heading h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mt-text);
}
.page-heading p {
  color: var(--mt-muted);
}

/* --- Cards -------------------------------------------------------------- */
.admin-shell .ui-card {
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-lg);
  box-shadow: var(--mt-shadow-sm);
  transition: box-shadow 0.2s ease;
  overflow: hidden;
}
.admin-shell .ui-card:hover {
  box-shadow: var(--mt-shadow-md);
}
.admin-shell .ui-card-header .ui-icon {
  color: var(--mt-green-600);
}
/* Icônes SVG uniformes dans les en-têtes de section */
.ui-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-shell .ui-card-header h2 .ui-icon-svg svg {
  width: 18px;
  height: 18px;
}
.admin-shell .ui-card-header h2 .ui-icon-svg {
  color: var(--mt-green-600);
}

/* --- KPI cards ---------------------------------------------------------- */
.admin-shell .ui-kpi-warning {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff7ed, #fff);
}
.admin-shell .ui-kpi-critical {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2, #fff);
}

/* --- Tables ------------------------------------------------------------- */
.admin-shell .ui-table a {
  color: var(--mt-green-700);
  font-weight: 600;
}

/* --- Badges ------------------------------------------------------------- */
.admin-shell .ui-badge-status-web,
.admin-shell .ui-badge-status-return,
.admin-shell .ui-badge-status-approved,
.admin-shell .ui-badge-status-refunded,
.admin-shell .ui-badge-status-completed,
.admin-shell .ui-badge-type {
  background: var(--mt-green-100);
  color: var(--mt-green-800);
}
.admin-shell .ui-badge-status-pending,
.admin-shell .ui-badge-warning {
  background: #fef3c7;
  color: #92400e;
}
.admin-shell .ui-badge-status-manual-review,
.admin-shell .ui-badge-status-pending-validation-by-finance {
  background: #ffedd5;
  color: #9a3412;
}
.admin-shell .ui-badge-status-collected,
.admin-shell .ui-badge-status-refund-processing {
  background: #dbeafe;
  color: #1e40af;
}
.admin-shell .ui-badge-status-captured {
  background: #1d4ed8;
  color: #fff;
}

/* Chips de filtre par statut (page /admin/requests) */

/* Timeline stoppee (demande rejetee ou annulee) */
.admin-shell .timeline-status-badge--failed {
  background: #fee2e2;
  color: #b91c1c;
}

/* --- Buttons ------------------------------------------------------------ */
.admin-shell .btn:active {
  transform: translateY(1px);
}
.admin-shell .btn-outline:hover,
.admin-shell .btn-outline-primary:hover {
  background: var(--mt-green-100);
  color: var(--mt-green-800);
  border-color: var(--mt-green-500);
}

/* --- Forms -------------------------------------------------------------- */
.admin-shell input,
.admin-shell select,
.admin-shell textarea {
  border-radius: 8px;
  border: 1px solid var(--mt-border);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.admin-shell input:focus,
.admin-shell select:focus,
.admin-shell textarea:focus {
  outline: none;
  border-color: var(--mt-green-500);
  box-shadow: 0 0 0 3px rgba(120, 190, 32, 0.18);
}
.admin-shell label {
  color: var(--mt-text);
  font-weight: 600;
}

/* --- Alerts / notices --------------------------------------------------- */
.admin-shell .ui-alert-info {
  background: var(--mt-green-50);
  border-color: var(--mt-green-200);
  color: var(--mt-green-800);
}

/* --- Tabs --------------------------------------------------------------- */
.admin-shell .tab {
  border-radius: var(--mt-radius-md) var(--mt-radius-md) 0 0;
  color: var(--mt-muted);
}
.admin-shell .tab.active {
  background: var(--mt-green-600);
  border-color: var(--mt-green-600);
  color: #fff;
}

/* --- Summary strip ------------------------------------------------------ */

/* ============================================================================
 * Request detail page — cartes RÉCAP requête & client
 * ========================================================================== */

/* Customer card */
.customer-card {
  font-size: 14px;
}
.customer-card #customer-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--mt-text);
  display: block;
  margin-bottom: 8px;
}
.customer-card .muted {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--mt-muted);
}
.customer-card .icon-small {
  color: var(--mt-green-600);
  display: inline-flex;
  width: 18px;
  justify-content: center;
}
.customer-card hr {
  border: none;
  border-top: 1px solid var(--mt-border);
  margin: 12px 0;
}

/* Attachments thumbnails (garde 48×48) */
.attachments-table img.attachment-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--mt-radius-sm);
  border: 1px solid var(--mt-border);
}

@media (max-width: 900px) {
}

/* ============================================================================
 * Image preview modal (pièces jointes)
 * La modale est créée dynamiquement en JS et attachée à documentElement.
 * ========================================================================== */
.image-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2147483647 !important;
  pointer-events: auto;
}
.image-modal.hidden {
  display: none !important;
}
.image-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 2147483646 !important;
}
.image-modal-content {
  position: relative;
  z-index: 2147483647 !important;
  max-width: 1100px;
  width: min(92%, 1100px);
  max-height: calc(100vh - 120px);
  padding: 16px;
  background: #fff;
  border: 1px solid var(--mt-green-500);
  border-radius: var(--mt-radius-lg);
  box-shadow:
    var(--mt-shadow-lg),
    0 40px 80px rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-modal-content img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  border-radius: var(--mt-radius-sm);
  object-fit: contain;
  display: block;
}
.image-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  background: var(--mt-green-500);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.25);
  transition: background 0.15s ease;
}
.image-modal-close:hover {
  background: var(--mt-green-600);
}

/* ============================================================================
 * Request progress timeline (REQUEST PROGRESS)
 * ========================================================================== */
.timeline-card {
  margin-bottom: 15px
}
.timeline-card .ui-card-header h2 {
  flex-wrap: wrap;
}
.timeline-status-badge {
  display: inline-flex;
  align-items: center;
  background: var(--mt-green-600);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 10px;
}
.timeline-wrap {
  padding: 24px 18px 18px;
  overflow-x: auto;
}
.progress-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  min-width: 760px;
}
.progress-timeline--cancellation {
  min-width: 0;
}
.timeline-step {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 6px;
}
/* Connecteur entre les étapes */
.timeline-step::before {
  content: "";
  position: absolute;
  top: 15px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--mt-border);
  z-index: 0;
}
.timeline-step:first-child::before {
  display: none;
}

.timeline-node {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: #fff;
  border: 2px solid var(--mt-border);
  color: var(--mt-muted);
  margin-bottom: 10px;
}
.timeline-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--mt-muted);
  line-height: 1.3;
  max-width: 130px;
}

/* Spinner de l'étape en cours */
.timeline-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--mt-green-200);
  border-top-color: var(--mt-green-600);
  animation: timeline-spin 0.8s linear infinite;
}
@keyframes timeline-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
 * Waybill timeline (onglet RETURN TRACKING / request-detail.php)
 * ========================================================================== */
.waybill-timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  color: var(--mt-green-700);
  margin: 18px 0 12px;
  user-select: none;
}
.waybill-timeline-chevron {
  display: inline-block;
  font-size: 13px;
  color: var(--mt-green-600);
}
.waybill-timeline-refs {
  font-weight: 700;
  color: var(--mt-green-700);
}
.waybill-track-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border-radius: var(--mt-radius-md);
  background: linear-gradient(135deg, var(--mt-green-500), var(--mt-green-600));
  box-shadow: var(--mt-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.waybill-track-link:hover {
  filter: brightness(1.05);
  box-shadow: var(--mt-shadow-md);
  transform: translateY(-1px);
  color: #fff;
}
.waybill-track-link .ui-icon {
  font-size: 13px;
}
.waybill-timeline-card {
  padding: 0;
}
.waybill-timeline-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 24px;
  flex-wrap: wrap;
}
.waybill-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 320px;
  min-width: 260px;
}
.waybill-timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 28px;
}
.waybill-timeline-item::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 13px;
  width: 2px;
  bottom: 0;
  background: var(--mt-green-300);
}
.waybill-timeline-item.is-last::before {
  display: none;
}
.waybill-timeline-dot {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--mt-green-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(86, 143, 23, 0.3);
}
.waybill-timeline-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 3px;
}
.waybill-timeline-label {
  font-weight: 700;
  color: var(--mt-text);
  font-size: 14px;
}
.waybill-timeline-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mt-muted);
  letter-spacing: 0.02em;
}
.waybill-timeline-meta .ui-icon {
  font-size: 13px;
}
.waybill-timeline-empty {
  color: var(--mt-muted);
  font-size: 13px;
  padding: 8px 0;
}
.waybill-timeline-art {
  flex: 0 0 auto;
  max-width: 420px;
}
.waybill-timeline-art-img {
  width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 720px) {
  .waybill-timeline-art {
    display: none;
  }
}

/* ============================================================================
 * Global admin loading overlay
 * ========================================================================== */
.admin-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.admin-loader.is-visible {
  display: flex;
}
.admin-loader-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--mt-green-200);
  border-radius: var(--mt-radius-lg);
  box-shadow: var(--mt-shadow-lg);
  padding: 18px 26px;
}
.admin-loader-text {
  font-family: var(--mt-font);
  font-size: 15px;
  font-weight: 700;
  color: var(--mt-text);
  letter-spacing: 0.01em;
}
.admin-loader-spinner {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 3px solid var(--mt-green-100);
  border-top-color: var(--mt-green-600);
  animation: timeline-spin 0.8s linear infinite;
  flex: 0 0 auto;
}
body.admin-loading {
  overflow: hidden;
}

/* ============================================================================
 * Flat design : suppression des border-radius (sauf icones de la timeline)
 * ========================================================================== */
body.layout-admin
  *:not(.timeline-node):not(.timeline-spinner):not(.admin-loader-spinner),
body.layout-admin *::before,
body.layout-admin *::after {
  border-radius: 0 !important;
}
.timeline-node,
.timeline-spinner,
.admin-loader-spinner {
  border-radius: 999px !important;
}

/* ============================================================================
 * MW Order detail - cadre englobant les onglets (Order Summary / Notes /
 * Transactions) et le contenu de l'onglet actif
 * ========================================================================== */
.mw-order-detail-page .mw-order-tabs-frame {
  margin-top: 0px;
  margin-left: 10px;
  margin-right: 10px;
  margin-bottom: 10px;
  padding: 0px;
}

/* ============================================================================
 * MW Order detail - organisation des blocs de synthese en colonnes
 * Customer Details | Order Status | Payment Information
 * ========================================================================== */
.mw-order-detail-page .detail-grid.top-summary,
.customer-detail-page .detail-grid.top-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

@media (min-width: 1000px) {
  .mw-order-detail-page .detail-grid.top-summary {
    grid-template-columns: minmax(0, 0.5fr) minmax(0, 1.5fr) minmax(0, 0.5fr);
  }
  .mw-order-detail-page .detail-grid.top-summary > section:nth-child(3) {
    grid-column: auto;
  }
}

@media (min-width: 1400px) {
  .mw-order-detail-page .detail-grid.top-summary {
    grid-template-columns: minmax(0, 0.5fr) minmax(0, 1.6fr) minmax(0, 0.5fr);
  }
}

/* Customer detail (admin) : 2 colonnes seulement -> Customer Details (large) | Order Status (etroit) */
@media (min-width: 900px) {
  .customer-detail-page .detail-grid.top-summary {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  }
}

.mw-order-detail-page .detail-grid.top-summary > section.ui-card,
.customer-detail-page .detail-grid.top-summary > section.ui-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mw-order-detail-page
  .detail-grid.top-summary
  > section.ui-card
  > .detail-section,
.customer-detail-page
  .detail-grid.top-summary
  > section.ui-card
  > .detail-section {
  flex: 1 1 auto;
}

/* Customer Details : identite, adresse de facturation, adresse de livraison */
.mw-order-detail-page .detail-columns,
.customer-detail-page .detail-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

@media (min-width: 640px) and (max-width: 999px) {
  .mw-order-detail-page .detail-columns,
  .customer-detail-page .detail-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Details : Transaction | Billing Address | Delivery Address alignes horizontalement */
.mw-order-detail-page .detail-columns-3,
.customer-detail-page .detail-columns-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .mw-order-detail-page .detail-columns-3,
  .customer-detail-page .detail-columns-3 {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* Payment Information : montants commande, montants paiement, transaction */
.mw-order-detail-page .payment-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

@media (min-width: 640px) and (max-width: 1399px) {
  .mw-order-detail-page .payment-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Blocs internes : fond neutre pour les distinguer dans la carte */
.mw-order-detail-page .detail-columns .detail-block,
.mw-order-detail-page .payment-stack .detail-block,
.customer-detail-page .detail-columns .detail-block {
  background: var(--mt-bg);
  border: 1px solid var(--mt-border);
  padding: 12px 14px;
  min-width: 0;
}

/* Details : 1er sous-bloc (type/date + montant + transaction) sans encadre,
   colle a la ref. -> pas de fond gris, pas de bordure */
.mw-order-detail-page .detail-columns-3 .detail-block-plain,
.customer-detail-page .detail-columns-3 .detail-block-plain {
  background: transparent;
  border: none;
  padding: 0;
}

/* Details : Billing/Delivery Address avec bandeau d'entete gris */
.mw-order-detail-page .detail-columns-3 .detail-block-boxed,
.customer-detail-page .detail-columns-3 .detail-block-boxed {
  background: #fff;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  padding: 0;
  overflow: hidden;
}

.mw-order-detail-page .detail-columns-3 .detail-block-boxed h3,
.customer-detail-page .detail-columns-3 .detail-block-boxed h3 {
  margin: 0;
  padding: 10px 14px;
  background: var(--mt-bg);
  border-bottom: 1px solid var(--mt-border);
}

.mw-order-detail-page .detail-columns-3 .detail-block-boxed .detail-block-body,
.customer-detail-page .detail-columns-3 .detail-block-boxed .detail-block-body {
  padding: 12px 14px;
}

.mw-order-detail-page
  .detail-columns-3
  .detail-block-boxed
  .detail-block-body
  p,
.customer-detail-page
  .detail-columns-3
  .detail-block-boxed
  .detail-block-body
  p {
  margin: 2px 0;
  font-size: 13px;
  color: var(--mt-text);
  overflow-wrap: anywhere;
}

.mw-order-detail-page .detail-block h3,
.customer-detail-page .detail-block h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mt-green-700);
}

.mw-order-detail-page .detail-block p,
.customer-detail-page .detail-block p {
  margin: 2px 0;
  font-size: 13px;
  color: var(--mt-text);
  overflow-wrap: anywhere;
}

/* Listes label / valeur sur deux colonnes compactes */
.mw-order-detail-page .detail-list,
.customer-detail-page .detail-list {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 6px 14px;
  align-items: baseline;
  margin: 0;
}

.mw-order-detail-page .detail-list dt,
.customer-detail-page .detail-list dt {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--mt-muted);
  white-space: nowrap;
}

.mw-order-detail-page .detail-list dd,
.customer-detail-page .detail-list dd {
  margin: 0;
  font-size: 13px;
  color: var(--mt-text);
  overflow-wrap: anywhere;
}

/* Variante icone + valeur (Customer Details : ID / email / telephone) :
   colonne icone compacte et alignement vertical centre sur la valeur,
   plutot que la baseline texte utilisee pour les listes label/valeur. */
.mw-order-detail-page .detail-list.detail-list-icon,
.customer-detail-page .detail-list.detail-list-icon {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  row-gap: 10px;
}
.mw-order-detail-page .detail-list.detail-list-icon dt,
.customer-detail-page .detail-list.detail-list-icon dt {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mw-order-detail-page .detail-list.detail-list-icon dt .ui-icon-svg svg,
.customer-detail-page .detail-list.detail-list-icon dt .ui-icon-svg svg {
  width: 15px;
  height: 15px;
}

.mw-order-detail-page .detail-list dd .code-inline,
.mw-order-detail-page .detail-list dd.code-inline,
.customer-detail-page .detail-list dd .code-inline,
.customer-detail-page .detail-list dd.code-inline {
  font-family: Consolas, monospace;
  font-size: 12px;
}
/* Order Status : sous-blocs alignes sur une meme ligne (lifecycle / delivery / flags) */
.mw-order-detail-page .status-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

@media (min-width: 640px) {
  .mw-order-detail-page .status-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.mw-order-detail-page .status-stack .detail-block {
  background: var(--mt-bg);
  border: 1px solid var(--mt-border);
  padding: 12px 14px;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}

/* Flags en pastilles plutot qu en lignes Yes/No */
.mw-order-detail-page .flag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mw-order-detail-page .flag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid var(--mt-border);
  font-size: 11px;
  font-weight: 700;
  color: var(--mt-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mw-order-detail-page .flag-chip .flag-chip-value {
  font-weight: 800;
  color: #9ca3af;
}

.mw-order-detail-page .flag-chip.is-on {
  background: var(--mt-green-50);
  border-color: var(--mt-green-300);
  color: var(--mt-green-800);
}

.mw-order-detail-page .flag-chip.is-on .flag-chip-value {
  color: var(--mt-green-700);
}
/* Alignement des 3 cartes de synthese : neutralise .ui-card + .ui-card{margin-top}
   herite de app.css qui decalait les 2e et 3e cartes dans la grille */
.mw-order-detail-page .detail-grid.top-summary > .ui-card,
.mw-order-detail-page .detail-grid.top-summary > .ui-card + .ui-card,
.customer-detail-page .detail-grid.top-summary > .ui-card,
.customer-detail-page .detail-grid.top-summary > .ui-card + .ui-card {
  margin: 0;
  align-self: stretch;
  height: 100%;
}

/* Les sous-blocs se repartissent la hauteur disponible pour un rendu equilibre */
.mw-order-detail-page .detail-columns,
.mw-order-detail-page .status-stack,
.mw-order-detail-page .payment-stack,
.customer-detail-page .detail-columns {
  height: 100%;
  align-content: start;
}

/* ============================================================================
 * MW Order detail - "Details" (badge + montant + adresses) et "Events" (v2)
 * Reprend la maquette : Customer Details | Details | Events sur une ligne,
 * puis Order Status | Payment Information en dessous.
 * ========================================================================== */
.mw-order-detail-page .customer-identity,
.customer-detail-page .customer-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.mw-order-detail-page .customer-avatar,
.customer-detail-page .customer-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--mt-green-500);
  color: var(--mt-green-700);
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.mw-order-detail-page .customer-name,
.customer-detail-page .customer-name {
  font-size: 15px;
  color: var(--mt-green-700);
}

.mw-order-detail-page .details-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--mt-muted);
  margin-bottom: 10px;
}

.mw-order-detail-page .details-payment-origin {
  text-align: center;
  margin: 10px 0 2px;
  font-size: 13px;
}

.mw-order-detail-page .details-payment-id {
  text-align: center;
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--mt-muted);
}

.mw-order-detail-page .amount-hero {
  text-align: center;
}

.mw-order-secondary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

@media (min-width: 1000px) {
  .mw-order-secondary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Events : liste chronologique avec puce icone + pagination */
.mw-order-detail-page .events-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.mw-order-detail-page .events-timeline-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  background: var(--mt-bg);
  border-left: 3px solid var(--mt-green-500);
}

.mw-order-detail-page .events-timeline-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mt-green-500);
  color: #fff;
}

.mw-order-detail-page .events-timeline-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--mt-text);
}

.mw-order-detail-page .events-timeline-date,
.mw-order-detail-page .events-timeline-author {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--mt-muted);
}

.mw-order-detail-page .events-timeline-author {
  color: var(--mt-green-700);
  font-weight: 700;
}

.mw-order-detail-page .events-pagination {
  margin-top: 10px;
  text-align: right;
  font-size: 12px;
  color: var(--mt-muted);
}

/* Barre de filtres inline au-dessus des tableaux Order Details / Product Details :
   pas de ligne de separation en haut, composants alignes en haut et sur la
   meme hauteur (recherche / select store / boutons search + refresh). */
.mw-order-detail-page .mw-inline-filter,
.customer-detail-page .mw-inline-filter {
  margin: 0 0 12px;
  padding: 0 18px;
  border-top: 0;
  align-items: flex-start;
}

.mw-order-detail-page .mw-inline-filter .orders-search,
.mw-order-detail-page .mw-inline-filter .field-filter,
.mw-order-detail-page .mw-inline-filter .field-select,
.mw-order-detail-page .mw-inline-filter .orders-filter-actions,
.mw-order-detail-page .mw-inline-filter .search-btn,
.mw-order-detail-page .mw-inline-filter .icon-btn,
.customer-detail-page .mw-inline-filter .orders-search,
.customer-detail-page .mw-inline-filter .field-filter,
.customer-detail-page .mw-inline-filter .field-select,
.customer-detail-page .mw-inline-filter .orders-filter-actions,
.customer-detail-page .mw-inline-filter .search-btn,
.customer-detail-page .mw-inline-filter .icon-btn {
  align-self: flex-start;
  height: 30px;
  box-sizing: border-box;
}

/* Order Status (customer detail) : pie chart + legende personnalisee cote a cote */
.customer-detail-page .order-status-chart {
  display: flex;
  align-items: center;
  gap: 20px;
}

.customer-detail-page .order-status-chart-canvas {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.customer-detail-page .order-status-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.customer-detail-page .order-status-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mt-text);
  white-space: nowrap;
}

.customer-detail-page .order-status-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Bandeau "Showing details scoped to order X" (customer-detail, quand la page
   est atteinte depuis une ligne precise de la liste des commandes). */
.customer-detail-page .ui-inline-note {
  margin: 0 10px 10px;
  padding: 10px 16px;
  background: var(--mt-green-50, #f3fae5);
  border: 1px solid var(--mt-green-300, #b4df66);
  border-radius: var(--mt-radius-md, 10px);
  font-size: 13px;
  font-weight: 600;
  color: var(--mt-green-800, #467411);
}

.customer-detail-page .ui-inline-note a {
  margin-left: 8px;
  font-weight: 800;
  color: var(--mt-green-700, #5a8f19);
  text-decoration: underline;
}

/* ============================================================================
 * MW Order detail - typographie unifiee
 * Une seule famille (--mt-font) et une echelle de 4 tailles :
 *   22px titre de page | 15px titre de carte | 13px valeurs | 12px libelles
 *   (11px reserve aux pastilles .ui-badge / .flag-chip)
 * ========================================================================== */
.mw-order-detail-page,
.mw-order-detail-page *,
.mw-order-detail-page input,
.mw-order-detail-page select,
.mw-order-detail-page textarea,
.mw-order-detail-page button {
  font-family: var(--mt-font);
}

.mw-order-detail-page {
  font-size: 13px;
  line-height: 1.5;
  color: var(--mt-text);
}

/* --- Titre de page --- */
.mw-order-detail-page .page-heading h1 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 8px 0 6px;
}

.mw-order-detail-page .page-heading p {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.mw-order-detail-page .page-heading .muted {
  font-size: 13px;
  font-weight: 600;
  color: var(--mt-muted);
}

/* --- Titres de carte --- */
.mw-order-detail-page .ui-card-header h1,
.mw-order-detail-page .ui-card-header h2 {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--mt-green-700);
}

.mw-order-detail-page .ui-card-header p {
  font-size: 12px;
  font-weight: 600;
}

/* --- Titres de sous-bloc --- */
.mw-order-detail-page .detail-block h3,
.mw-order-detail-page .split-card-header strong {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mt-green-700);
}

/* --- Libelles (dt, en-tetes de tableau) --- */
.mw-order-detail-page .detail-list dt,
.mw-order-detail-page .ui-table th {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--mt-muted);
}

/* --- Valeurs / texte courant --- */
.mw-order-detail-page .detail-list dd,
.mw-order-detail-page .detail-block p,
.mw-order-detail-page .ui-table td,
.mw-order-detail-page .ui-empty,
.mw-order-detail-page .notice,
.mw-order-detail-page a,
.mw-order-detail-page .muted {
  font-size: 13px;
  line-height: 1.5;
}

.mw-order-detail-page .detail-list dd,
.mw-order-detail-page .detail-block p,
.mw-order-detail-page .ui-table td {
  font-weight: 500;
}

.mw-order-detail-page .detail-list dd strong,
.mw-order-detail-page .ui-table td strong {
  font-weight: 800;
}

/* --- Identifiants : meme police, tracking legerement resserre --- */
.mw-order-detail-page .code-inline,
.mw-order-detail-page .detail-list dd.code-inline,
.mw-order-detail-page .detail-list dd .code-inline {
  font-family: var(--mt-font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

/* --- Pastilles --- */
.mw-order-detail-page .ui-badge,
.mw-order-detail-page .flag-chip {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.03em;
}

/* --- Boutons --- */
.mw-order-detail-page .btn {
  font-size: 13px;
  font-weight: 800;
}

/* ---------------------------------------------------------------------------
 * Section Splits : mise en forme alignee sur les autres blocs
 * ------------------------------------------------------------------------ */
.mw-order-detail-page .split-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
}

.mw-order-detail-page .split-card {
  background: var(--mt-bg);
  border: 1px solid var(--mt-border);
  padding: 12px 14px;
  min-width: 0;
}

.mw-order-detail-page .split-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--mt-border);
}

.mw-order-detail-page .split-card-header .muted {
  margin-left: 8px;
  font-weight: 600;
  color: var(--mt-muted);
}

.mw-order-detail-page .split-meta {
  margin: 0;
}

/* ---------------------------------------------------------------------------
 * Sub-order cards: ORDER DETAILS sections in request-detail & mw-order-detail
 * Each sub-order (split) rendered as a distinct card with its product lines.
 * ------------------------------------------------------------------------ */
.order-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
}
.sub-order-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px 16px;
}
.sub-order-card {
  background: var(--mt-bg);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-md);
  overflow: hidden;
}
.sub-order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #f9fafb;
  border-bottom: 1px solid var(--mt-border);
}
.sub-order-card-header strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--mt-green-700);
}
.sub-order-card-header .muted {
  font-weight: 600;
  color: var(--mt-muted);
  margin-left: 6px;
}
.sub-order-card-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.sub-order-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--mt-border);
}
.sub-order-card .ui-table {
  margin: 0;
  border-radius: 0;
  border: none;
}
.sub-order-card .ui-table thead tr {
  background: #eef1f5;
}
.sub-order-count {
  padding: 4px 16px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--mt-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* ============================================================================
 * Admin Orders list - bandeau KPI : voir .orders-summary-band (charte
 * partagee avec la page Requests, cf. bloc "Design system" plus bas).
 * ========================================================================== */

/* --- Pagination --------------------------------------------------------- */
/* Le design de .orders-pagination (JS, /admin/orders) et .ui-pagination
   (helper ui_pagination(), templates/components.php) vit desormais dans
   assets/ui-pagination.css, chargee sur TOUS les layouts : les pages
   publiques ne chargent pas admin-theme.css et affichaient une pagination
   sans style. Ne pas redupliquer ces regles ici. */
/* Icone du titre ORDERS alignee sur le reste de la page */
.orders-page .orders-heading-icon {
  display: inline-flex;
  align-items: center;
  color: var(--mt-green-600);
  font-size: 24px;
}

.orders-page .orders-heading-icon .ui-icon-svg svg {
  width: 24px;
  height: 24px;
}
/* ==========================================================================
   Zones de recherche — design partage (helpers ui_filter_* de components.php)
   Reference : la barre de filtres de /admin/orders.
   ========================================================================== */

/* Le rendu plat (sans arrondi) etait limite a .orders-page : on l'applique a
   toutes les barres de filtres pour un rendu identique sur tous les ecrans. */
.orders-filter-bar input,
.orders-filter-bar select,
.orders-filter-bar .field-select,
.orders-filter-bar .field-select-static,
.orders-filter-bar .multi-select-button,
.orders-filter-bar .search-btn,
.orders-filter-bar .icon-btn,
.orders-filter-bar .orders-search input[type="search"],
.orders-filter-bar .field-date-input {
  border-radius: 0;
}

.orders-filter-bar {
  row-gap: 10px;
}

/* Champ libellé (texte / date / select) au look .field-select */
.orders-filter-bar .field-filter {
  cursor: text;
  flex: 1 1 200px;
  min-width: 180px;
  gap: 8px;
}

.orders-filter-bar .field-filter .field-label {
  margin-right: 0;
}

.orders-filter-bar .field-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: auto;
  border: 0;
  outline: none;
  padding: 5px;
  background: transparent;
  color: var(--mt-text, #111827);
  font: inherit;
  box-shadow: none;
}

.orders-filter-bar select.field-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 16px;
  paddind-left: 5px;
}

.orders-filter-bar .field-filter:focus-within {
  border-color: var(--primary, #78be20);
  box-shadow: 0 0 0 2px rgba(120, 190, 32, 0.15);
}

/* Le bouton reset est parfois un lien : meme rendu que les <button class="icon-btn"> */
.orders-filter-bar a.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* ============================================================================
 * Design system — repris du design (visuel uniquement) de portal-return-
 * refund-app-V2 : bande KPI illustrée, chart-card, onglets in-page, kv-row,
 * mini-grid, amount-hero, pill-nav. Pas de modale : ces composants sont
 * pensés pour un rendu in-page (voir plan de reprise).
 * ========================================================================== */

/* --- KPI band (bande de tuiles illustrées, inspirée de art() en V2) ---- */
.admin-shell .kpi-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 5px;
}
.admin-shell .kpi-band-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.admin-shell .kpi-tile.is-warning {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff7ed, #fff);
}
.admin-shell .kpi-tile.is-critical {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2, #fff);
}
.admin-shell .kpi-tile-art svg {
  width: 24px;
  height: 24px;
}
.admin-shell .kpi-tile-body {
  min-width: 0;
  flex: 1 1 auto;
}
.admin-shell .kpi-tile-delta {
  font-size: 12px;
  font-weight: 700;
  color: var(--mt-green-700);
  margin-left: 6px;
}

/* --- Chart card ---------------------------------------------------------- */
.admin-shell .chart-card {
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-lg);
  box-shadow: var(--mt-shadow-sm);
  padding: 16px;
}
.admin-shell .chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.admin-shell .chart-card-canvas-wrap {
  position: relative;
  height: 240px;
}
.admin-shell .chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

/* --- In-page tabs (design "record-tabs" de V2, sans overlay) ----------- */
.admin-shell .ui-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--mt-border);
  margin-bottom: 16px;
}
.admin-shell .ui-tabs-nav button.ui-tab-btn {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--mt-muted);
  border-radius: var(--mt-radius-md) var(--mt-radius-md) 0 0;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}
.admin-shell .ui-tabs-nav button.ui-tab-btn:hover {
  color: var(--mt-green-700);
  background: var(--mt-green-50);
}
.admin-shell .ui-tabs-nav button.ui-tab-btn.is-active {
  color: var(--mt-green-700);
  background: var(--mt-green-50);
  border-color: var(--mt-border);
  border-bottom: 2px solid var(--mt-green-600);
}
.admin-shell .ui-tab-panel[hidden] {
  display: none !important;
}

/* --- kv-row (icône + libellé + valeur, façon "modale record" V2) ------- */
.admin-shell .kv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid #f1f5f4;
}
.admin-shell .kv-row:last-child {
  border-bottom: none;
}
.admin-shell .kv-row-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: var(--mt-radius-md);
  background: var(--mt-green-50);
  color: var(--mt-green-600);
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-shell .kv-row-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mt-muted);
  min-width: 130px;
}
.admin-shell .kv-row-value {
  flex: 1 1 auto;
  text-align: right;
  font-weight: 700;
  color: var(--mt-text);
}

/* --- mini-grid (adresses, infos secondaires en grille compacte) -------- */
.admin-shell .mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.admin-shell .mini-grid-item {
  background: #f9fafb;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-md);
  padding: 10px 12px;
}
.admin-shell .mini-grid-item .mini-grid-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mt-muted);
  margin-bottom: 3px;
}
.admin-shell .mini-grid-item .mini-grid-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--mt-text);
}

/* --- amount-hero (montant mis en avant, ex. total commande) ------------ */
.admin-shell .amount-hero-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--mt-text);
}

/* --- pill-nav (sous-onglets du module Report) --------------------------- */
.admin-shell .pill-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.admin-shell .pill-nav button.pill-nav-btn {
  appearance: none;
  border: 1px solid var(--mt-green-300);
  background: #fff;
  color: var(--mt-green-700);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.admin-shell .pill-nav button.pill-nav-btn:hover {
  background: var(--mt-green-50);
}

/* --- Order notes (onglet Notes, mw-order-detail.php) -------------------- */
.admin-shell .order-note-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-shell .order-note-form textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}
.admin-shell .order-note-form button {
  align-self: flex-end;
}
.admin-shell .order-note-list .kv-row-value {
  text-align: left;
  white-space: pre-wrap;
}
.admin-shell .report-landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.admin-shell .report-landing-card {
  display: block;
  text-decoration: none;
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-xl);
  box-shadow: var(--mt-shadow-sm);
  padding: 22px;
  transition:
    box-shadow 0.2s ease,
    transform 0.12s ease,
    border-color 0.15s ease;
}
.admin-shell .report-landing-card .report-landing-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--mt-radius-md);
  background: var(--mt-green-50);
  color: var(--mt-green-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.admin-shell .report-landing-card .report-landing-icon svg {
  width: 26px;
  height: 26px;
}
.admin-shell .report-landing-card h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--mt-text);
  margin: 0 0 4px;
}
.admin-shell .report-landing-card p {
  color: var(--mt-muted);
  font-size: 13px;
  margin: 0;
}

@media (max-width: 900px) {
  .orders-filter-bar .orders-filter-actions {
    margin-left: 0;
  }
}
/* Boutons d'action de la barre : meme gabarit que .search-btn (30px) */
.orders-filter-bar .icon-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  flex: 0 0 auto;
  align-self: center;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.orders-filter-bar .icon-btn:hover {
  background: #f3f4f6;
  color: #374151;
  border-color: var(--primary, #78be20);
}

.orders-filter-bar .orders-filter-actions {
  align-items: center;
}
/* Selecteur de plage de dates (ui_filter_daterange) : meme gabarit que les
   autres champs de la barre. */
.orders-filter-bar .field-daterange {
  flex: 1 1 200px;
  min-width: 180px;
}

.orders-filter-bar .field-daterange .field-value {
  margin-left: 0;
}

/* --- Task acceptance banner --------------------------------------------- */
.task-acceptance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
  padding: 14px 22px;
  margin: -22px -22px 24px -22px;
  border-radius: 0;
  gap: 16px;
}

.task-acceptance-message {
  font-size: 14px;
  font-weight: 500;
  color: #1e40af;
  letter-spacing: -0.005em;
}

.task-acceptance-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.task-acceptance-banner .btn-accept {
  background: var(--mt-green-500);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: var(--mt-radius-md);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(120, 190, 32, 0.3);
}

.task-acceptance-banner .btn-accept:hover {
  background: var(--mt-green-600);
  box-shadow: 0 2px 6px rgba(120, 190, 32, 0.4);
}

.task-acceptance-banner .btn-go-back {
  background: transparent;
  color: var(--mt-green-700);
  border: 1px solid var(--mt-green-500);
  padding: 8px 16px;
  border-radius: var(--mt-radius-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.task-acceptance-banner .btn-go-back:hover {
  background: var(--mt-green-50);
  border-color: var(--mt-green-600);
  color: var(--mt-green-800);
  text-decoration: none;
}

/* ============================================================================
 * V2 VISUAL ALIGNMENT PASS
 * Objectif : faire correspondre police, couleurs, radius, ombres, tableaux,
 * badges, boutons et titres au design réel de portal-return-refund-app-V2
 * (css/style.css), sans modifier les templates PHP existants (mêmes classes,
 * juste ré-habillage). Les tokens --mt-* sont redéfinis ici : comme la
 * quasi-totalité du thème les référence, ceci rétablit un rendu plat et
 * cohérent partout d'un coup. Le reste (dégradés en dur, majuscules, couleurs
 * de badges) est surchargé explicitement ci-dessous.
 * ========================================================================== */
:root {
  /* Police V2 : Open Sans (chargée via @import en tête de fichier) */
  --mt-font:
    "Open Sans", "Appian Open Sans", -apple-system, "Segoe UI", Roboto, Arial,
    sans-serif;

  /* Palette V2 (tokens sampled sur platform.leroymerlin.co.za, cf. V2/css/style.css) */
  --mt-bg: #f5f9f0;
  --mt-surface: #ffffff;
  --mt-text: #222222;
  --mt-muted: #777777;
  --mt-border: #dddddd;

  --bg: #f5f9f0;
  --text: #222222;
  --muted: #777777;
  --border: #dddddd;

  /* V2 est un design plat : pas d'ombre portée, radius quasi nul */
  --mt-shadow-sm: none;
  --mt-shadow-md: none;
  --mt-shadow-lg: none;
  --shadow: none;

  --mt-radius-sm: 2px;
  --mt-radius-md: 3px;
  --mt-radius-lg: 4px;
  --mt-radius-xl: 4px;

  /* Tokens additionnels V2 (bande KPI, filet de section, statuts) */
  --v2-band: #d6e8bc;
  --v2-page-bg: #f5f9f0;
  --v2-rule: #5f8d74;
  --v2-cancel: #3e581f;
  --v2-green: #0aa25c;
  --v2-teal: #51b68f;
  --v2-tealdark: #005f61;
  --v2-amber: #b8860b;
  --v2-orange: #f97316;
  --v2-red: #b3392f;
  --v2-grey: #6e7b6e;
  --v2-row-alt: rgba(231, 231, 231, 0.2);
}

/* --- Radius/ombres à plat partout (le bloc "Flat design" existant gère déjà
   border-radius:0 !important ; on neutralise ici les box-shadow résiduels) --- */
body.layout-admin *:not(.report-landing-card):not(.chart-card) {
  box-shadow: none;
}

/* --- Titres de section : V2 = noir, fin (400), majuscule, filet vert dessous,
   pas de dégradé de fond --- */
.admin-shell .ui-card-header h1,
.admin-shell .ui-card-header h2 {
  color: #000;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: normal;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-shell .ui-card-header h2 .ui-icon,
.admin-shell .ui-card-header h2 .ui-icon-svg {
  color: var(--v2-rule);
}
.admin-shell .ui-card-header {
  background: transparent;
  border-bottom: 1px solid var(--v2-rule);
}
.admin-shell .ui-card-header.compact {
  border-bottom: 1px solid var(--v2-rule);
  border-radius: var(--mt-radius-lg) var(--mt-radius-lg) 0 0;
}
.page-heading h1 {
  color: #000;
  font-weight: 700;
  letter-spacing: normal;
}

/* --- KPI (dashboard, ui_kpi()) : carte plate blanche, bordure fine, icône
   illustrée à gauche (kpi-art), sans dégradé ni ombre --- */
.admin-shell .ui-kpi {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  border-radius: var(--mt-radius-lg);
  box-shadow: var(--mt-shadow-sm);
  padding: 14px 16px;
  transition:
    box-shadow 0.2s ease,
    transform 0.12s ease;
}
.admin-shell .ui-kpi:hover {
  box-shadow: var(--mt-shadow-md);
  transform: none;
}
.admin-shell .ui-kpi-warning,
.admin-shell .ui-kpi-critical {
  background: #fff;
}
.admin-shell .ui-kpi-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-shell .ui-kpi-icon {
  background: none;
  color: var(--mt-green-600);
  border-radius: var(--mt-radius-md);
  box-shadow: none;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-shell .ui-kpi-icon .kpi-art {
  width: 44px;
  height: 40px;
}
.admin-shell .kpi-art-img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-shell .kpi-art-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.admin-shell .ui-kpi-label {
  font-size: 13px;
  color: var(--mt-muted);
  margin: 0;
}
.admin-shell .ui-kpi-value {
  color: var(--mt-text);
  font-weight: 400;
  font-size: 24px;
}

/* --- KPI band (requests.php) : même traitement plat + icône illustrée --- */
.admin-shell .kpi-tile {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--mt-radius-lg);
  box-shadow: none;
  padding: 14px 16px;
  transition:
    box-shadow 0.2s ease,
    transform 0.12s ease;
}
.admin-shell .kpi-tile:hover {
  box-shadow: var(--mt-shadow-md);
  transform: none;
}
.admin-shell .kpi-tile.is-warning,
.admin-shell .kpi-tile.is-critical {
  background: #fff;
}
.admin-shell .kpi-tile-art {
  flex: 0 0 44px;
  width: 44px;
  height: 40px;
  border-radius: var(--mt-radius-md);
  background: none;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-shell .kpi-tile-art .kpi-art {
  width: 44px;
  height: 40px;
}
.admin-shell .kpi-tile-label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: #555;
  margin: 0 0 2px;
}
.admin-shell .kpi-tile-value {
  font-size: 24px;
  font-weight: 400;
  color: var(--mt-text);
  line-height: 1.15;
}

/* --- Tables : entête blanc, texte normal (pas de majuscule), bordures
   verticales/horizontales, lignes alternées, survol vert clair (V2 .grid) --- */
.admin-shell .ui-table th {
  background: #fff;
  color: var(--mt-text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  border-bottom: 1px solid var(--mt-border);
  padding: 12px 14px;
  border-right: 1px solid #e7e7e7;
}
.admin-shell .ui-table th:last-child {
  border-right: none;
}
.admin-shell .ui-table td {
  border-bottom: 1px solid #e7e7e7;
  vertical-align: middle;
  border-right: 1px solid #e7e7e7;
}
.admin-shell .ui-table td:last-child {
  border-right: none;
}
.admin-shell .ui-table tbody tr:nth-child(odd) {
  background: var(--v2-row-alt);
}
.admin-shell .ui-table tr:hover td {
  background: #eef6e4;
}

/* --- Badges : couleurs à plat façon V2 (status pills), pas de pilule ronde --- */
.admin-shell .ui-badge {
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  padding: 3px 9px;
}
.admin-shell .ui-badge-status-web,
.admin-shell .ui-badge-status-mkp,
.admin-shell .ui-badge-type {
  background: var(--mt-green-500);
  color: #fff;
}
.admin-shell .ui-badge-status-return,
.admin-shell .ui-badge-status-approved,
.admin-shell .ui-badge-status-completed,
.admin-shell .ui-badge-status-settled {
  background: var(--v2-green);
  color: #fff;
}
.admin-shell .ui-badge-status-refunded,
.admin-shell .ui-badge-status-refund-processing,
.admin-shell .ui-badge-status-collected {
  background: var(--v2-teal);
  color: #fff;
}
.admin-shell .ui-badge-status-captured {
  background: var(--mt-blue-600);
  color: #fff;
}
.admin-shell .ui-badge-status-pending,
.admin-shell .ui-badge-warning,
.admin-shell .ui-badge-status-manual-review {
  background: var(--v2-amber);
  color: #fff;
}
.admin-shell .ui-badge-status-pending-validation-by-finance {
  background: var(--v2-orange);
  color: #fff;
}
.admin-shell .ui-badge-status-rejected,
.admin-shell .ui-badge-status-cancelled {
  background: var(--v2-red);
  color: #fff;
}
.admin-shell .ui-badge-neutral {
  background: var(--v2-grey);
  color: #fff;
}

/* --- Boutons : plats, verts, majuscules (V2 .btn) --- */
.admin-shell .btn {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  padding: 9px 16px;
  background: var(--mt-green-500);
  border: 1px solid var(--mt-green-500);
  box-shadow: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.admin-shell .btn:hover {
  box-shadow: none;
  background: var(--mt-green-600);
  border-color: var(--mt-green-600);
}
.admin-shell .btn-outline,
.admin-shell .btn-outline-primary {
  background: var(--mt-green-50);
  color: var(--mt-green-700);
  border: 1px solid var(--mt-green-300);
  box-shadow: none;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

/* --- Nav topbar : majuscule + filet vert sous l'onglet actif (V2 .nav-item) --- */
.admin-nav-item {
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.2px;
}

/* --- Avatar, dégradés en dur -> couleur pleine --- */
.avatar {
  background: var(--mt-green-500);
  box-shadow: none;
}
.admin-shell .summary-strip {
  background: var(--v2-band);
  border: 1px solid var(--mt-green-200);
  border-radius: var(--mt-radius-lg);
  border-color: var(--v2-rule);
}
.admin-shell .amount-hero {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: var(--v2-band);
  border: 1px solid var(--mt-green-200);
  border-radius: var(--mt-radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  border-color: var(--v2-rule);
}
.admin-shell .amount-hero-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #33421f;
}
.admin-shell .pill-nav button.pill-nav-btn.is-active {
  background: var(--mt-green-500);
  border-color: var(--mt-green-500);
  color: #fff;
}

/* --- Chart / report cards : bordure fine sans ombre, titre noir fin --- */
.admin-shell .chart-card,
.admin-shell .report-landing-card {
  box-shadow: none;
  border-color: var(--mt-border);
}
.admin-shell .report-landing-card:hover {
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.1);
  transform: none;
  border-color: var(--mt-green-300);
}
.admin-shell .chart-card-title {
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #000;
}

/* --- KPI band : titre de groupe + filet vert (façon kpiColumn() de V2),
   tuiles fusionnées en une seule carte plate avec dividers verticaux au lieu
   de cartes individuelles espacées --- */
.admin-shell .kpi-band-title {
  font-size: 22px;
  font-weight: 400;
  text-transform: uppercase;
  color: #000;
  margin: 0 0 6px;
}
.admin-shell .kpi-band-rule {
  height: 1px;
  background: var(--v2-rule);
  margin-bottom: 12px;
}
.admin-shell .kpi-band-card {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  flex: 1 1 auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.admin-shell .kpi-band-card .kpi-tile {
  flex: 1 1 200px;
  border: none;
  border-right: 1px solid var(--mt-border);
  background: transparent;
}
.admin-shell .kpi-band-card .kpi-tile:last-child {
  border-right: none;
}
.admin-shell .kpi-band-card .kpi-tile:hover {
  transform: none;
}
@media (max-width: 700px) {
  .admin-shell .kpi-band-card {
    flex-direction: column;
  }
  .admin-shell .kpi-band-card .kpi-tile {
    border-right: none;
    border-bottom: 1px solid var(--mt-border);
  }
  .admin-shell .kpi-band-card .kpi-tile:last-child {
    border-bottom: none;
  }
}

/* --- Task panel / filter-chips / tabs (page Requests) : ré-habillage plat --- */
.admin-shell .task-item {
  border-radius: 0;
  box-shadow: none;
}
.admin-shell .task-item:hover {
  background: #eef6e4;
  border-color: var(--mt-green-300);
}
.admin-shell .tab-row .tab {
  text-transform: uppercase;
  box-shadow: none;
}

/* --- Requests page : bande verte englobant tabs + bande KPI (V2) --------- */
.admin-shell .requests-page.admin-page {
  gap: 10px;
}
.admin-shell .requests-layout {
  align-items: start;
  margin-left: 10px;
  margin-right: 10px;
}
.admin-shell .requests-layout > .ui-card + .ui-card {
  margin-left: 0px;
  margin-right: 0px;
}

/* --- Requests page : le dropdown REQUEST TYPE / REQUEST STATUS ne doit pas
   etre coupe par le radius/overflow:hidden de la carte (.ui-card{overflow:
   hidden} sert a arrondir les coins, mais coupe aussi le panneau du
   multi-select qui deborde en position absolue). On desactive le clipping
   sur la carte et on reporte l'arrondi sur le conteneur du tableau, qui est
   le dernier bloc visible de la carte. */
.admin-shell .request-table-card {
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.admin-shell .request-table-card .ui-table-wrap {
  flex: 1 1 auto;
  overflow: auto;
  position: relative;
  z-index: 0;
}
.admin-shell .request-table-card #requests-pagination-wrap {
  flex-shrink: 0;
  min-height: 48px;
  border-radius: 0 0 var(--mt-radius-xl, 20px) var(--mt-radius-xl, 20px);
}
.admin-shell .request-table-card .orders-filter-bar {
  position: relative;
  z-index: 5;
}

/* --- Requests page : police du tableau et de la barre de filtres ---- */
/* Hauteur des lignes réduite pour correspondre à la police plus petite (uniforme avec .orders-table). */
.admin-shell .requests-page .ui-table th,
.admin-shell .requests-page .ui-table td {
  font-size: 13px;
  padding: 6px 14px;
  line-height: 1.3;
}
.admin-shell .requests-page .orders-filter-bar,
.admin-shell .requests-page .orders-filter-bar input,
.admin-shell .requests-page .orders-filter-bar select,
.admin-shell .requests-page .orders-filter-bar button,
.admin-shell .requests-page .orders-filter-bar .field-label,
.admin-shell .requests-page .orders-filter-bar .field-value,
.admin-shell .requests-page .orders-filter-bar .multi-select-button,
.admin-shell .requests-page .orders-filter-bar .multi-select-row,
.admin-shell .requests-page .orders-filter-bar .multi-select-row .label {
  font-size: 13px;
}
.admin-shell .requests-summary-band {
  background: var(--v2-band);
  border: 0px;
  padding: 14px 16px 12px;
  margin-bottom: 0;
}
.admin-shell .requests-summary-band .tab-row {
  margin-bottom: 10px;
}
.admin-shell .requests-summary-band .tab {
  background: rgba(255, 255, 255, 0.55);
}
.admin-shell .requests-summary-band .tab.active {
  background: var(--mt-green-600);
  border-color: var(--mt-green-600);
}
.admin-shell .requests-summary-band .kpi-band-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
}
.admin-shell .requests-summary-band .kpi-band-rule {
  margin-bottom: 8px;
  background: var(--v2-rule);
}
.admin-shell .requests-summary-band .kpi-band-card {
  gap: 8px;
}
.admin-shell .requests-summary-band .kpi-tile {
  padding: 8px 10px;
  gap: 8px;
}
.admin-shell .requests-summary-band .kpi-tile-art,
.admin-shell .requests-summary-band .kpi-art-img {
  width: 32px;
  height: 30px;
}
.admin-shell .requests-summary-band .kpi-tile-label {
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  line-height: 1.2;
}
.admin-shell .requests-summary-band .kpi-tile-value {
  font-size: 16px;
  font-weight: 700;
}

/* --- Orders page : bande KPI alignee sur la charte de la page Requests
   (bande verte + kpi-band-col / kpi-band-title / kpi-band-rule / kpi-band-card) --- */
.admin-shell .orders-summary-band {
  background: var(--v2-band);
  border: 0px;
  padding: 14px 16px 12px;
}
.admin-shell .orders-summary-band .kpi-band {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.admin-shell .orders-summary-band .kpi-band-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
}
.admin-shell .orders-summary-band .kpi-band-rule {
  margin-bottom: 8px;
  background: var(--v2-rule);
}
.admin-shell .orders-summary-band .kpi-band-card {
  gap: 8px;
}
.admin-shell .orders-summary-band .kpi-tile {
  padding: 8px 10px;
  gap: 8px;
}
.admin-shell .orders-summary-band .kpi-tile-art,
.admin-shell .orders-summary-band .kpi-art-img {
  width: 32px;
  height: 30px;
}
.admin-shell .orders-summary-band .kpi-tile-label {
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  line-height: 1.2;
}
.admin-shell .orders-summary-band .kpi-tile-value {
  font-size: 16px;
  font-weight: 700;
}
@media (max-width: 640px) {
  .admin-shell .orders-summary-band {
    margin: 16px 16px 0;
  }
}

/* --- Dashboard page : reprend la meme bande KPI que Orders list admin,
   mais le titre de page reste dans le bandeau (au lieu d'un page-heading
   separe au-dessus), via .dashboard-band-heading. --- */
.admin-shell .dashboard-band-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0px;
}
.admin-shell .dashboard-band-heading .orders-heading-left h1 {
  margin: 0px !important;
}
.admin-shell .dashboard-band-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-shell .dashboard-band-meta p {
  margin: 0;
  color: var(--v2-rule);
  font-size: 14px;
  font-weight: 600;
}
.admin-shell .dashboard-band-meta .refresh-note {
  margin-top: 0;
  color: var(--v2-rule);
}
@media (max-width: 640px) {
  .admin-shell .dashboard-band-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Tracking page : les 2 charts sont empiles a gauche, alignes sur le
   haut de la liste tracking a droite (au lieu d'une bande de KPI + 2 charts
   cote a cote au-dessus de la liste). ------------------------------------- */
.admin-shell .tracking-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.admin-shell .tracking-charts-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 340px;
}
#tracking-charts-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-shell .tracking-list-col {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 1100px) {
  .admin-shell .tracking-layout {
    flex-direction: column;
  }
  .admin-shell .tracking-charts-col {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* Ligne du haut : lien "Hide/Show charts" (aligne a gauche avec les charts)
   et selecteur STORE (aligne a gauche avec la liste tracking), sur la meme
   ligne, juste au-dessus du bloc charts+liste. */
.admin-shell .tracking-top-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-shell .tracking-charts-link {
  flex: 0 0 340px;
  font-size: 13px;
  font-weight: 700;
  color: var(--mt-green-700);
  text-decoration: none;
  cursor: pointer;
}
.admin-shell .tracking-charts-link:hover {
  text-decoration: underline;
}

/* Selecteur STORE deplace au-dessus du bloc tracking (charts + liste), pour
   filtrer/recharger la liste en Ajax sans impacter les charts (cf. script
   inline de templates/tracking.php). */
.admin-shell .tracking-store-row {
  flex: 0 0 auto;
  margin-bottom: 0;
  border-top: 0;
  padding: 0;
}
.admin-shell .tracking-store-row .field-select-static {
  margin-top: 0;
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
}
@media (max-width: 1100px) {
  .admin-shell .tracking-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .admin-shell .tracking-charts-link {
    flex: 0 0 auto;
  }
}

/* --- Tracking page : police du tableau et de la barre de filtres --- */
/* Hauteur des lignes réduite pour correspondre à la police plus petite (uniforme avec .orders-table). */
.admin-shell .tracking-page .ui-table th,
.admin-shell .tracking-page .ui-table td {
  font-size: 13px;
  padding: 6px 14px;
  line-height: 1.3;
}

/* Aligne le champ de recherche sur le haut, comme les selects STATUS/STORE. */
.admin-shell .tracking-page .orders-filter-bar {
  align-items: flex-start;
}
.admin-shell .tracking-page .orders-search,
.admin-shell .tracking-page .field-select-static {
  margin-top: 0;
}

/* Espacements verticaux reduits entre les blocs de la page (top-row, layout
   charts+liste, en-tete de carte, barre de filtres). */
.admin-shell .tracking-page.admin-page {
  gap: 10px;
  margin: 10px;
}
.admin-shell .tracking-page .ui-card-header {
}
.customers-page {
  margin: 10px;
}
/* Message de chargement affiche pendant le rechargement Ajax de la liste
   tracking (selecteur STORE), cf. reloadTrackingList() dans tracking.php. */
#tracking-table-wrap {
  position: relative;
  min-height: 80px;
}
#tracking-table-wrap.is-loading > * {
  visibility: hidden;
}
#tracking-table-wrap.is-loading::after {
  content: "Loading...";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  color: var(--mt-green-700);
  font-weight: 700;
  font-size: 13px;
  z-index: 5;
}

/* ============================================================================
 * REQUEST DETAIL — redesign (bandeau vert + onglets), Return/Refund Portal
 * ============================================================================ */

/* Lien discret "Back to requests", au dessus du bandeau vert. */
.request-detail-backlink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0px;
  margin-top: 10px;
  margin-left: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mt-muted);
  text-decoration: none;
}
.request-detail-backlink:hover {
  color: var(--mt-green-700);
  text-decoration: underline;
}

/* Bandeau titre : REQUEST #id | Customer | Magento ID + bouton ADD NOTES. */
.request-detail-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background-color: #78BE20FF !important;
  color: #fff;
  border-radius: var(--mt-radius-lg);
  padding: 14px 20px;
  margin-bottom: 12px;
  box-shadow: var(--mt-shadow-md, 0 4px 10px rgba(0, 0, 0, 0.08));
}
.request-detail-banner-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.request-detail-banner-sep {
  opacity: 0.6;
  margin: 0 6px;
  font-weight: 400;
}
.admin-shell .btn.request-detail-add-notes {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #fff;
  color: var(--mt-green-700);
  font-weight: 700;
}
.admin-shell .btn.request-detail-add-notes:hover {
  background: var(--mt-green-50);
  border-color: var(--mt-green-50);
  color: var(--mt-green-800);
}

/* Illustration en bas de la carte CUSTOMER DETAILS (sidebar), miroir du design. */
.request-sidebar-illustration {
  display: block;
  max-width: 100%;
  margin: 12px auto 0;
}

.customer-orders-notice-text {
    font-size: 13px;
    color: var(--mt-muted);
    margin-top: 6px;
}
/* ===========================================================================
   RBAC: Profiles (templates/roles.php) & Privileges (templates/permissions.php)
   =========================================================================== */
.admin-shell .roles-page .role-card-header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-shell .roles-page .role-code-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: normal;
}
.admin-shell .roles-page .role-badge-system {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.admin-shell .roles-page .role-description {
  padding: 12px 18px 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.admin-shell .roles-page .role-permissions-form {
  padding: 18px !important;
}
.admin-shell .roles-page .permission-category {
  margin-bottom: 20px;
}
.admin-shell .roles-page .permission-category:last-of-type {
  margin-bottom: 0;
}
.admin-shell .roles-page .permission-category-label {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.admin-shell .roles-page .permission-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-shell .roles-page .permission-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  font-size: 13px;
  color: #1f2937;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 200px;
  flex: 1 1 220px;
}
.admin-shell .roles-page .permission-chip:hover {
  border-color: var(--primary);
}
.admin-shell .roles-page .permission-chip input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-dark);
  flex-shrink: 0;
  cursor: pointer;
}
.admin-shell .roles-page .permission-chip:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.admin-shell .roles-page .role-form-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
}
.admin-shell .roles-page .create-role-card .filter-bar {
  align-items: flex-end;
}

.admin-shell .permissions-page .permissions-body {
  background: #fff;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.admin-shell .permissions-page .permission-category-block {
  margin-bottom: 24px;
}
.admin-shell .permissions-page .permission-category-block:last-child {
  margin-bottom: 0;
}
.admin-shell .permissions-page .permission-category-block h2 {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.admin-shell .permissions-page .ui-table td code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #1f2937;
}
.admin-shell .permissions-page .permission-role-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 600;
}

/*
 * Full-screen "please wait" overlay shown on the public return/refund/cancel
 * wizards while the final YES submission is in flight (createServiceRequest
 * now does more synchronous work server-side: Mirakl thread notification,
 * 1P return waybill creation call to partners-service, finance email, etc.,
 * so it can take a few seconds -- this prevents the customer from thinking
 * the page is frozen or double-clicking YES). Toggled via display:none/flex
 * by each page's submit*() function; markup lives in each wizard template.
 */
.wizard-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  text-align: center;
}
.wizard-loading-overlay .wizard-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(120, 190, 32, 0.25);
  border-top-color: #78be20;
  border-radius: 50%;
  animation: wizard-loading-spin 0.8s linear infinite;
}
.wizard-loading-overlay p {
  margin-top: 16px;
  font-weight: 600;
  color: #333;
}
@keyframes wizard-loading-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Lazy-load spinner (AJAX tab content)
   ========================================================================== */
.ui-lazy-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 0;
}
.ui-lazy-spinner::after {
  content: '';
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--primary-soft, #f0f7e9);
  border-top-color: var(--primary, #78a22f);
  animation: page-loading-spin 0.8s linear infinite;
}
