/* MyLubPortal design tokens, read from the Figma file "MyLubPortal (Copy)" (fileKey gXVhD8MqjfCbg8li61WR8k):
   "Account • Desktop" (9406:55898), "Connexion • V2" (4840:200597) and the Statistics "table-wrapper" (12985:19715). */
:root {
  --ui-font-family-sans: "Roboto", "Segoe UI", Arial, sans-serif;
  --ui-font-family-heading: "Nunito", "Segoe UI", Arial, sans-serif;

  --ui-color-foreground-primary: #374649;
  --ui-color-foreground-secondary: #5f6b6d;
  --ui-color-foreground-muted: #a1a9aa;
  --ui-color-foreground-inverse: #ffffff;
  --ui-color-foreground-brand: #ed0000;

  --ui-color-border-subtle: #c1c6c7;
  --ui-color-border-field: #d3d4d5;
  --ui-color-border-light: #f1f3f3;

  --ui-color-background-page: #ffffff;
  --ui-color-background-layer: #ffffff;
  --ui-color-background-field: #ffffff;
  --ui-color-background-muted: #f7f9fa;

  --ui-color-background-status-info: #f7f9fa;
  --ui-color-border-status-info: #c1c6c7;
  --ui-color-foreground-status-info: #374649;
  --ui-color-background-status-danger: #fdeeee;
  --ui-color-foreground-status-danger: #d80000;
  /* Success green: the check mark colour of the Statistics table (#2e7d32). */
  --ui-color-background-status-success: #e8f5e9;
  --ui-color-foreground-status-success: #2e7d32;
  /* Warning amber (the customer check's "check before creating"). */
  --ui-color-background-status-warning: #fff4e5;
  --ui-color-foreground-status-warning: #b45309;

  --ui-component-button-color-background-primary: #ed0000;
  --ui-component-button-color-background-primary-hover: #c40000;
  --ui-component-link-color-default: #ed0000;

  /* Statistics table (table-wrapper). */
  --ui-table-border: #e5e7eb;
  --ui-table-heading: #1f2937;
  --ui-table-zebra: #f9fafb;

  --ui-size-radius-050: 8px;
  --ui-size-radius-100: 10px;
  --ui-size-radius-200: 20px;
  --ui-size-radius-rounded: 9999px;

  --ui-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 rgba(0, 0, 0, 0.05);

  --ui-tag-azure: #3092d0;
  --ui-tag-bb: #d63864;
  --ui-tag-sre: #285aff;
  --ui-tag-aws: #fdc311;
  --ui-tag-cst: #7054d4;

  /* Content column: 1216px, as in the design's 1440px frames. */
  --ui-content-width: 1216px;
}

html {
  font-size: 14px;
}

/* Column layout keeps the footer at the bottom of short pages and after the content on long ones. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: var(--ui-font-family-sans);
  font-size: 14px;
  line-height: 22px;
  background-color: var(--ui-color-background-page);
  color: var(--ui-color-foreground-primary);
}

/* Material Symbols Rounded icons. */
.ms {
  font-family: "Material Symbols Rounded";
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: "FILL" 0, "GRAD" 0;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.ms-filled {
  font-variation-settings: "FILL" 1, "GRAD" 0;
}

/* Page title ("My Account": Nunito 700 30/36, red) and intro text. */
.ui-page-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ui-page-head h1 {
  margin: 0;
  font-family: var(--ui-font-family-heading);
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: -0.225px;
  color: var(--ui-color-foreground-brand);
}

.ui-page-head p {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--ui-color-foreground-primary);
}

/* Card section title ("Personal Information": Nunito 700 20/28). */
.ui-section-title {
  margin: 0;
  font-family: var(--ui-font-family-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: -0.1px;
  color: var(--ui-color-foreground-primary);
}

/* Breadcrumb */
.ui-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 24px 0 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--ui-color-foreground-secondary);
}

.ui-breadcrumb .sep {
  color: var(--ui-color-foreground-muted);
}

.ui-breadcrumb .current {
  color: var(--ui-color-foreground-primary);
  font-weight: 500;
}

/* Link */
.ui-link {
  color: var(--ui-component-link-color-default);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ui-link:hover {
  color: var(--ui-component-button-color-background-primary-hover);
}

/* Buttons: pill, Roboto 500 14/22 (Figma "button"). Primary is filled red, tertiary is the red outline. */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 14px;
  border: 1px solid transparent;
  border-radius: var(--ui-size-radius-rounded);
  font-family: var(--ui-font-family-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ui-btn .ms {
  font-size: 18px;
}

.ui-btn-primary {
  min-height: 42px;
  padding: 10px 18px;
  background: var(--ui-component-button-color-background-primary);
  color: var(--ui-color-foreground-inverse);
}

.ui-btn-primary:hover {
  background: var(--ui-component-button-color-background-primary-hover);
  color: var(--ui-color-foreground-inverse);
}

.ui-btn-tertiary {
  background: var(--ui-color-background-layer);
  border-color: var(--ui-color-foreground-brand);
  color: var(--ui-color-foreground-brand);
}

.ui-btn-tertiary:hover {
  background: var(--ui-color-foreground-brand);
  color: var(--ui-color-foreground-inverse);
}

/* Small coloured pill, e.g. report tags and statuses. */
.ui-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--ui-size-radius-rounded);
  background: var(--tag-color, var(--ui-tag-sre));
  color: var(--ui-color-foreground-inverse);
  font-size: 11px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Message box */
.ui-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--ui-color-border-status-info);
  border-radius: var(--ui-size-radius-100);
  background: var(--ui-color-background-status-info);
  color: var(--ui-color-foreground-status-info);
  font-size: 14px;
  line-height: 22px;
}

.ui-alert .ms {
  font-size: 20px;
  line-height: 22px;
}

.ui-alert-title {
  font-weight: 500;
}

.ui-alert-danger {
  border-color: var(--ui-color-foreground-status-danger);
  background: var(--ui-color-background-status-danger);
  color: var(--ui-color-foreground-status-danger);
}

.ui-alert-warning {
  border-color: var(--ui-color-foreground-status-warning);
  background: var(--ui-color-background-status-warning);
  color: var(--ui-color-foreground-status-warning);
}

.ui-alert-success {
  border-color: var(--ui-color-foreground-status-success);
  background: var(--ui-color-background-status-success);
  color: var(--ui-color-foreground-status-success);
}

/* Card (Figma "Frame 4284": radius 20, #c1c6c7 border, soft shadow, 32px padding). */
.ui-card {
  background: var(--ui-color-background-layer);
  border: 1px solid var(--ui-color-border-subtle);
  border-radius: var(--ui-size-radius-200);
  box-shadow: var(--ui-shadow-card);
}

/* Form fields: label Roboto 500 14/22, input 42px, radius 10, #d3d4d5 border, text 16px. */
.ui-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ui-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.ui-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--ui-color-foreground-primary);
}

.ui-input {
  width: 100%;
  height: 42px;
  padding: 9px 10px 9px 14px;
  border: 1px solid var(--ui-color-border-field);
  border-radius: var(--ui-size-radius-100);
  background: var(--ui-color-background-field);
  font-family: var(--ui-font-family-sans);
  font-size: 16px;
  line-height: 22px;
  color: var(--ui-color-foreground-primary);
}

.ui-input:focus {
  outline: none;
  border-color: var(--ui-color-foreground-primary);
  box-shadow: 0 0 0 2px rgba(55, 70, 73, 0.15);
}

.ui-input.input-validation-error {
  border-color: var(--ui-color-foreground-status-danger);
}

.ui-field-error {
  font-size: 13px;
  line-height: 18px;
  color: var(--ui-color-foreground-status-danger);
}

.ui-field-error:empty {
  display: none;
}

.ui-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  cursor: pointer;
}

.ui-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--ui-color-foreground-brand);
}

.ui-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ui-alert .validation-summary-errors ul,
.ui-alert ul {
  margin: 0;
  padding-left: 16px;
}

/* Table (Statistics "table-wrapper"): #e5e7eb grid, radius 8, bold uppercase headers, zebra rows. */
.ui-table-wrap {
  overflow-x: auto;
  background: var(--ui-color-background-layer);
  border: 1px solid var(--ui-table-border);
  border-radius: 8px;
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 16px;
}

.ui-table th {
  padding: 16px 12px;
  background: var(--ui-color-background-layer);
  border-bottom: 1px solid var(--ui-table-border);
  border-left: 1px solid var(--ui-table-border);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  color: var(--ui-table-heading);
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.ui-table td {
  padding: 12px;
  border-bottom: 1px solid var(--ui-table-border);
  border-left: 1px solid var(--ui-table-border);
  vertical-align: middle;
  color: var(--ui-color-foreground-primary);
}

.ui-table th:first-child,
.ui-table td:first-child {
  border-left: 0;
}

.ui-table tbody tr:nth-child(even) td {
  background: var(--ui-table-zebra);
}

.ui-table tbody tr:last-child td {
  border-bottom: 0;
}

.ui-muted {
  font-size: 12px;
  line-height: 16px;
  color: var(--ui-color-foreground-muted);
}

/* Table tools (table-tools.js): a search box above the results and column headers that sort.
   .tt-hide is what the search puts on the rows, tables and cards it leaves out. */
.tt-hide {
  display: none !important;
}

.tt-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.tt-search {
  position: relative;
  flex: 0 1 340px;
  margin: 0;
}

.tt-search .ms {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--ui-color-foreground-secondary);
  pointer-events: none;
}

.tt-search .ui-input {
  width: 100%;
  padding-inline-start: 40px;
}

.tt-count {
  font-size: 13px;
  color: var(--ui-color-foreground-secondary);
}

.tt-print-note {
  display: none;
}

th.tt-sort {
  cursor: pointer;
  user-select: none;
}

th.tt-sort::after {
  content: " \21C5";
  opacity: 0.3;
}

th.tt-sort[aria-sort="ascending"]::after {
  content: " \25B2";
  opacity: 1;
}

th.tt-sort[aria-sort="descending"]::after {
  content: " \25BC";
  opacity: 1;
}

th.tt-sort:hover,
th.tt-sort:focus-visible {
  color: var(--ui-color-foreground-brand);
}

/* On paper: the rows left by the search, a line saying so, and no controls. */
@media print {
  .tt-search,
  .tt-count,
  th.tt-sort::after {
    display: none !important;
  }

  .tt-bar:not(.tt-on) {
    display: none;
  }

  .tt-on .tt-print-note {
    display: block;
    font-size: 10pt;
  }
}

/* Phones */
@media (max-width: 576px) {
  .ui-page-head h1 {
    font-size: 24px;
    line-height: 30px;
  }

  .ui-page-head p {
    font-size: 14px;
    line-height: 22px;
  }

  .ui-breadcrumb {
    padding-top: 16px;
  }

  .ui-form-actions {
    flex-wrap: wrap;
  }

  .ui-form-actions .ui-btn {
    flex: 1 1 auto;
  }
}

/* Phones: every data table (.ui-table and the reports' .rpt-table) becomes one card per row instead of a wide
   grid that needs sideways scrolling. site.js copies each column's header into the cells' data-label, shown
   before the value; the cell marked .stk-title heads the card. `table:is(...)` outranks the desktop rules. */
@media screen and (max-width: 576px) {
  .ui-table-wrap,
  .rpt-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
  }

  table:is(.ui-table, .rpt-table),
  table:is(.ui-table, .rpt-table) :is(tbody, tfoot) {
    display: block;
  }

  table:is(.ui-table, .rpt-table) thead {
    display: none;
  }

  table:is(.ui-table, .rpt-table) tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    padding: 8px 0;
    border: 1px solid var(--ui-table-border);
    border-radius: 8px;
    background: var(--ui-color-background-layer);
  }

  /* The row carries the colour here, so the cells drop their zebra and status backgrounds. */
  table:is(.ui-table, .rpt-table) td {
    display: flow-root;
    width: auto;
    padding: 3px 12px;
    border: 0;
    background: none !important;
    box-shadow: none !important;
    line-height: 20px;
    text-align: right;
  }

  table:is(.ui-table, .rpt-table) td[data-label]::before {
    content: attr(data-label);
    float: left;
    margin-right: 12px;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    color: var(--ui-color-foreground-secondary);
    text-transform: uppercase;
  }

  table:is(.ui-table, .rpt-table) td.stk-title {
    order: -1;
    padding-bottom: 6px;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
  }

  table:is(.ui-table, .rpt-table) td.stk-title::before {
    content: none;
  }

  /* Totals and group headings span columns, so they have no label of their own. */
  table:is(.ui-table, .rpt-table) td[colspan] {
    font-weight: 700;
    text-align: left;
  }

  table:is(.ui-table, .rpt-table) td.stk-empty {
    display: none;
  }

  /* Cells holding a list (item chips): label on its own line, the list below it. */
  table:is(.ui-table, .rpt-table) td:has(.rpt-chips) {
    text-align: left;
  }

  table:is(.ui-table, .rpt-table) td:has(.rpt-chips)::before {
    float: none;
    display: block;
    margin: 0 0 4px;
  }
}

/* ==========================================================================
   RTL (Right-to-Left) Styles for Arabic Localization
   ========================================================================== */
html[dir="rtl"] {
  font-family: "Cairo", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] .ui-page-head h1,
html[dir="rtl"] .ui-section-title {
  font-family: "Cairo", "Nunito", sans-serif;
  letter-spacing: normal;
}

html[dir="rtl"] .mlp-topbar-inner {
  flex-direction: row-reverse;
}

html[dir="rtl"] .mlp-main-right {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .mlp-nav-sep {
  margin: 0 12px;
}

html[dir="rtl"] .ui-breadcrumb .sep {
  transform: rotate(180deg);
}

html[dir="rtl"] .rpt-variety-chevron {
  transform: scaleX(-1);
}

html[dir="rtl"] .rpt-variety-card[open] .rpt-variety-chevron {
  transform: scaleX(-1) rotate(-90deg);
}

html[dir="rtl"] .dropdown-menu-end {
  right: auto;
  left: 0;
}

/* ==========================================================================
   Global Print Styles for Clean PDF Export
   ========================================================================== */
@media print {
  .mlp-header,
  .mlp-topbar,
  .mlp-nav,
  .mlp-footer,
  .mlp-account-menu,
  .ui-breadcrumb,
  .rpt-filter,
  .rpt-actions,
  .rpt-route-btn,
  .rpt-col-icon,
  .rpt-loading,
  .ui-alert,
  [data-print] {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11pt;
  }

  .mlp-page,
  .rpt-page {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .rpt-van-card,
  .rpt-table-wrap,
  table.rpt-table {
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .rpt-table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .rpt-table th,
  .rpt-table td {
    border-bottom: 1px solid #ddd !important;
    padding: 6px 8px !important;
  }

  .rpt-print-range {
    display: block !important;
    margin-bottom: 12px;
    font-size: 11pt;
    font-weight: 600;
    color: #333 !important;
  }
}

