/* AllSafe platform - application theme on top of Bootstrap 5.3.
   Brand: the AllSafe "S" mark - emerald green (#00A868) into deep teal (#007078) - on a dark teal ink.
   Green is the brand and "done" colour; teal is the action colour; amber is kept for "needs attention" only.
   Logical properties (inline-start / inline-end) keep every rule right for Arabic (RTL). */
:root {
  /* Brand */
  --as-green: #00a868;          /* logo emerald - decorative (bars, dots, icons) */
  --as-green-600: #008752;      /* accessible green for text and filled buttons */
  --as-green-50: #e7f6ee;
  --as-teal: #0a6f78;           /* primary action colour */
  --as-teal-700: #085a62;
  --as-teal-800: #06464d;
  --as-teal-100: #d5ecec;
  --as-teal-50: #ecf6f6;
  --as-ink-900: #052227;        /* sidebar */
  --as-ink-800: #082e34;
  --as-ink-700: #0d3d44;
  --as-grad: linear-gradient(135deg, #00a868 0%, #0a6f78 100%);
  --as-grad-btn: linear-gradient(135deg, #008752 0%, #0a6f78 100%);
  --as-grad-ink: linear-gradient(140deg, #052227 0%, #0a3c43 55%, #0a6f78 130%);
  /* Neutrals */
  --as-bg: #f2f6f6;
  --as-surface: #ffffff;
  --as-surface-2: #f7fafa;
  --as-border: #dde6e6;
  --as-border-strong: #c6d4d4;
  --as-text: #12252a;
  --as-muted: #5c6d72;
  /* Attention (kept from the old palette: safety amber) */
  --as-amber: #f2a900;
  --as-amber-dark: #b67f00;
  /* Shape */
  --as-radius: 12px;
  --as-radius-sm: 8px;
  --as-shadow-sm: 0 1px 2px rgba(10, 40, 45, .05), 0 1px 3px rgba(10, 40, 45, .05);
  --as-shadow: 0 6px 20px rgba(10, 40, 45, .08);
  --as-ring: 0 0 0 .2rem rgba(0, 168, 104, .28);
  --as-sidebar-w: 264px;

  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  --bs-body-font-size: .9375rem;
  --bs-body-color: #12252a;
  --bs-border-color: #dde6e6;
  --bs-border-radius: .5rem;
  --bs-primary: #0a6f78;
  --bs-primary-rgb: 10, 111, 120;
  --bs-success: #0e8a55;
  --bs-success-rgb: 14, 138, 85;
  --bs-link-color: #0a6f78;
  --bs-link-color-rgb: 10, 111, 120;
  --bs-link-hover-color: #06464d;
  --bs-link-hover-color-rgb: 6, 70, 77;
  --bs-secondary-color: #5c6d72;
  --bs-tertiary-bg: #f2f6f6;
}

body { background: var(--as-bg); color: var(--as-text); -webkit-font-smoothing: antialiased; }
a { text-decoration-thickness: 1px; text-underline-offset: 2px; }
::selection { background: rgba(0, 168, 104, .22); }

/* =====================================================================
   Buttons - one consistent system: solid (primary / accent), soft outline, quiet (light / link)
   ===================================================================== */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-padding-y: .5rem;
  --bs-btn-padding-x: 1rem;
  --bs-btn-font-size: .9rem;
  --bs-btn-border-radius: var(--as-radius-sm);
  --bs-btn-focus-box-shadow: var(--as-ring);
  --bs-btn-disabled-opacity: .5;
  letter-spacing: .005em;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn .bi { font-size: 1.02em; vertical-align: -.1em; }
.btn-sm { --bs-btn-padding-y: .34rem; --bs-btn-padding-x: .72rem; --bs-btn-font-size: .8125rem; --bs-btn-border-radius: 7px; }
.btn-lg { --bs-btn-padding-y: .72rem; --bs-btn-padding-x: 1.3rem; --bs-btn-font-size: 1rem; --bs-btn-border-radius: 10px; }

.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--as-teal); --bs-btn-border-color: var(--as-teal);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--as-teal-700); --bs-btn-hover-border-color: var(--as-teal-700);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--as-teal-800); --bs-btn-active-border-color: var(--as-teal-800);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--as-teal); --bs-btn-disabled-border-color: var(--as-teal);
  box-shadow: 0 1px 2px rgba(6, 70, 77, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}
/* Accent = the brand gradient, for the one main call to action on a screen (Sign in, Save and send ...) */
.btn-accent {
  --bs-btn-color: #fff; --bs-btn-bg: var(--as-green-600); --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: #fff; --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-border-color: transparent;
  background-image: var(--as-grad-btn);
  box-shadow: 0 4px 12px rgba(0, 135, 82, .25), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn-accent:hover, .btn-accent:focus-visible { background-image: linear-gradient(135deg, #007447 0%, #085a62 100%); }
.btn-success {
  --bs-btn-bg: var(--as-green-600); --bs-btn-border-color: var(--as-green-600);
  --bs-btn-hover-bg: #00703f; --bs-btn-hover-border-color: #00703f;
  --bs-btn-active-bg: #005f36; --bs-btn-active-border-color: #005f36;
  --bs-btn-disabled-bg: var(--as-green-600); --bs-btn-disabled-border-color: var(--as-green-600);
}
.btn-danger {
  --bs-btn-bg: #c0352b; --bs-btn-border-color: #c0352b;
  --bs-btn-hover-bg: #a12a21; --bs-btn-hover-border-color: #a12a21;
  --bs-btn-active-bg: #8c241c; --bs-btn-active-border-color: #8c241c;
}
.btn-warning {
  --bs-btn-color: #3b2a00; --bs-btn-bg: var(--as-amber); --bs-btn-border-color: var(--as-amber);
  --bs-btn-hover-color: #3b2a00; --bs-btn-hover-bg: #dc9a00; --bs-btn-hover-border-color: #dc9a00;
}
/* Soft outline buttons: white face, coloured text, tinted on hover */
.btn-outline-primary {
  --bs-btn-color: var(--as-teal); --bs-btn-bg: #fff; --bs-btn-border-color: #b9d3d5;
  --bs-btn-hover-color: var(--as-teal-800); --bs-btn-hover-bg: var(--as-teal-50); --bs-btn-hover-border-color: var(--as-teal);
  --bs-btn-active-color: var(--as-teal-800); --bs-btn-active-bg: var(--as-teal-100); --bs-btn-active-border-color: var(--as-teal);
  --bs-btn-disabled-color: var(--as-teal); --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: #b9d3d5;
}
.btn-outline-secondary {
  --bs-btn-color: #34474c; --bs-btn-bg: #fff; --bs-btn-border-color: var(--as-border-strong);
  --bs-btn-hover-color: var(--as-text); --bs-btn-hover-bg: #eef3f3; --bs-btn-hover-border-color: #aebfc0;
  --bs-btn-active-color: var(--as-text); --bs-btn-active-bg: #e3ebeb; --bs-btn-active-border-color: #aebfc0;
  --bs-btn-disabled-color: #5c6d72; --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--as-border-strong);
}
.btn-outline-danger {
  --bs-btn-color: #b42318; --bs-btn-bg: #fff; --bs-btn-border-color: #f0c0bb;
  --bs-btn-hover-color: #8c1d14; --bs-btn-hover-bg: #fdecea; --bs-btn-hover-border-color: #d9534a;
  --bs-btn-active-color: #8c1d14; --bs-btn-active-bg: #f9d9d5; --bs-btn-active-border-color: #d9534a;
}
.btn-outline-warning {
  --bs-btn-color: #8a5a00; --bs-btn-bg: #fff; --bs-btn-border-color: #f1d488;
  --bs-btn-hover-color: #6b4600; --bs-btn-hover-bg: #fff6e0; --bs-btn-hover-border-color: var(--as-amber);
  --bs-btn-active-color: #6b4600; --bs-btn-active-bg: #ffedbf; --bs-btn-active-border-color: var(--as-amber);
}
.btn-outline-success {
  --bs-btn-color: var(--as-green-600); --bs-btn-bg: #fff; --bs-btn-border-color: #b5dfc8;
  --bs-btn-hover-color: #005f36; --bs-btn-hover-bg: var(--as-green-50); --bs-btn-hover-border-color: var(--as-green-600);
}
.btn-light {
  --bs-btn-color: #2a3d42; --bs-btn-bg: #eef3f3; --bs-btn-border-color: #eef3f3;
  --bs-btn-hover-color: var(--as-text); --bs-btn-hover-bg: #e2eaea; --bs-btn-hover-border-color: #e2eaea;
  --bs-btn-active-bg: #d7e2e2; --bs-btn-active-border-color: #d7e2e2;
}
.btn-link { --bs-btn-color: var(--as-teal); --bs-btn-hover-color: var(--as-teal-800); text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.btn-close:focus { box-shadow: var(--as-ring); }

/* Forms */
.form-label { font-weight: 650; font-size: .86rem; color: #1f3338; margin-bottom: .35rem; }
.form-text { color: var(--as-muted); font-size: .8rem; }
/* Mandatory fields: assets/js/app.js marks the label of every required control */
label.is-required::after { content: "*"; content: "*" / ""; color: #c8323a; font-weight: 800; margin-inline-start: .25rem; }
label.is-required.has-star::after { content: none; }
.as-required-note { font-size: .8rem; color: var(--as-muted); margin: 0 0 .85rem; }
.as-required-note .as-star { color: #c8323a; font-weight: 800; }
.form-control:user-invalid, .form-select:user-invalid { border-color: #d64545; background-color: #fffafa; }
.form-control:user-invalid:focus, .form-select:user-invalid:focus { border-color: #d64545; box-shadow: 0 0 0 .2rem rgba(214, 69, 69, .15); }
.form-control, .form-select {
  border-color: var(--as-border-strong); border-radius: var(--as-radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: #8a9a9e; }
.form-control:hover:not(:disabled):not([readonly]), .form-select:hover:not(:disabled) { border-color: #a9bcbd; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--as-teal);
  box-shadow: 0 0 0 .2rem rgba(10, 111, 120, .16);
}
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: #eef3f3; }
.form-check-input:checked { background-color: var(--as-teal); border-color: var(--as-teal); }
.input-group-text { background: var(--as-surface-2); border-color: var(--as-border-strong); color: var(--as-muted); }

/* =====================================================================
   Shell: sidebar, top bar, content
   ===================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: var(--as-sidebar-w); flex: 0 0 var(--as-sidebar-w);
  background: linear-gradient(180deg, var(--as-ink-900) 0%, var(--as-ink-800) 100%);
  color: #c2d5d3;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.app-brand {
  display: flex; align-items: center; gap: .7rem;
  padding: 1.05rem 1.15rem; color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: sticky; top: 0; z-index: 1; background: var(--as-ink-900);
}
.app-brand:hover { color: #fff; }
.app-brand-logo { width: 40px; height: 40px; flex: 0 0 40px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 168, 104, .35)); }
.app-brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; line-height: 1.1; }
.app-brand-sub { font-size: .68rem; color: #86aaa6; font-weight: 500; line-height: 1.25; margin-top: .1rem; }
/* Older markup (error page) still uses the square mark */
.app-brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--as-grad); color: #fff;
  display: grid; place-items: center; font-size: 1.1rem;
}

.app-nav { padding: .6rem 0 1.25rem; flex: 1 1 auto; }
.app-nav-section {
  padding: 1.05rem 1.4rem .4rem; font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: #6c938f;
}
.app-nav-link {
  position: relative;
  display: flex; align-items: center; gap: .7rem;
  margin: 1px .7rem; padding: .5rem .7rem;
  color: #c2d5d3; text-decoration: none; font-size: .9rem; font-weight: 500;
  border-radius: 8px;
  transition: background-color .15s ease, color .15s ease;
}
.app-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-nav-link.active { background: rgba(0, 168, 104, .16); color: #fff; font-weight: 600; }
.app-nav-link.active::before {
  content: ""; position: absolute; inset-block: 7px; inset-inline-start: -.7rem;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--as-grad);
}
[dir="rtl"] .app-nav-link.active::before { border-radius: 4px 0 0 4px; }
.app-nav-link .bi { font-size: 1.05rem; color: #8fb3af; width: 1.15rem; text-align: center; }
.app-nav-link:hover .bi { color: #d9ebe8; }
.app-nav-link.active .bi { color: #35d494; }
.app-nav-link:focus-visible { outline: 2px solid var(--as-green); outline-offset: -2px; }

.app-sidebar-foot {
  padding: .9rem 1.25rem 1.1rem; border-top: 1px solid rgba(255,255,255,.07);
  font-size: .72rem; color: #6c938f; line-height: 1.45;
}
.app-sidebar-foot .ar { font-family: "Noto Naskh Arabic", Tahoma, "Segoe UI", sans-serif; font-size: .82rem; color: #9cc0bb; display: block; }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--as-border);
  min-height: 64px; padding: .5rem 1.5rem;
  display: flex; align-items: center; gap: .85rem;
  position: sticky; top: 0; z-index: 20;
}
.app-topbar-title { min-width: 0; }
.app-topbar-eyebrow { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--as-green-600); line-height: 1.2; }
.app-topbar h1 { font-size: 1.08rem; margin: 0; font-weight: 700; color: var(--as-text); line-height: 1.3; }
.app-content { padding: 1.6rem 1.75rem; flex: 1 1 auto; }
.app-footer { padding: 1rem 1.75rem 1.25rem; color: var(--as-muted); font-size: .76rem; border-top: 1px solid var(--as-border); background: var(--as-surface); }

/* Top bar tools */
.topbar-search { position: relative; }
.topbar-search .bi { position: absolute; inset-inline-start: .65rem; top: 50%; transform: translateY(-50%); color: #8a9a9e; pointer-events: none; font-size: .85rem; }
.topbar-search .form-control { padding-inline-start: 2rem; background: var(--as-surface-2); border-color: var(--as-border); border-radius: 999px; }
.topbar-search .form-control:focus { background: #fff; }
.serial-search { width: 190px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; padding: 0;
  display: inline-grid; place-items: center; border-radius: 10px;
  color: #34474c; background: transparent; border: 1px solid transparent;
}
.icon-btn:hover { background: #eef3f3; color: var(--as-text); }
.icon-btn:focus-visible { box-shadow: var(--as-ring); outline: 0; }
.icon-btn .bi { font-size: 1.15rem; }
.notify-count {
  position: absolute; top: 3px; inset-inline-end: 2px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #d92d20; color: #fff; font-size: .66rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.user-menu-btn {
  display: flex; align-items: center; gap: .55rem; padding: .25rem .55rem .25rem .3rem;
  border-radius: 999px; border: 1px solid var(--as-border); background: #fff; color: var(--as-text); font-weight: 600; font-size: .85rem;
}
.user-menu-btn:hover { background: var(--as-surface-2); border-color: var(--as-border-strong); }
.user-menu-btn:focus-visible { box-shadow: var(--as-ring); outline: 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-grid; place-items: center;
  background: var(--as-grad); color: #fff; font-size: .74rem; font-weight: 700; letter-spacing: .02em;
}
.avatar-lg { width: 52px; height: 52px; font-size: 1.1rem; }
.dropdown-menu { border-color: var(--as-border); border-radius: 10px; box-shadow: var(--as-shadow); padding: .4rem; font-size: .9rem; }
.dropdown-item { border-radius: 7px; padding: .45rem .7rem; }
.dropdown-item:active { background: var(--as-teal); }
.dropdown-header-user { padding: .5rem .7rem .6rem; }
.dropdown-header-user .small { color: var(--as-muted); }

.sidebar-toggle { display: none; }

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1040;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  [dir="rtl"] .app-sidebar { transform: translateX(100%); }
  .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-shell.sidebar-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(5, 34, 39, .5); z-index: 1030;
  }
  .sidebar-toggle { display: inline-grid; }
  .app-topbar { padding: .5rem 1rem; }
  .app-content { padding: 1rem; }
}

/* =====================================================================
   Panels, page heads, stat tiles
   ===================================================================== */
.card {
  --bs-card-border-color: var(--as-border);
  --bs-card-border-radius: var(--as-radius);
  --bs-card-inner-border-radius: calc(var(--as-radius) - 1px);
  --bs-card-cap-padding-y: .85rem;
  --bs-card-cap-padding-x: 1.1rem;
  --bs-card-spacer-x: 1.1rem;
  box-shadow: var(--as-shadow-sm);
}
.card-header {
  background: var(--as-surface); border-bottom-color: var(--as-border);
  font-weight: 700; font-size: .95rem; color: var(--as-text);
}
.card-header > .bi:first-child, .card-header > span > .bi:first-child { color: var(--as-teal); }
.card-footer { background: var(--as-surface-2); border-top-color: var(--as-border); }
.list-group { --bs-list-group-border-color: var(--as-border); --bs-list-group-action-hover-bg: var(--as-surface-2); --bs-list-group-active-bg: var(--as-teal); --bs-list-group-active-border-color: var(--as-teal); }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .9rem;
  margin-bottom: 1.35rem;
}
.page-head h2 { font-size: 1.45rem; margin: 0; font-weight: 750; letter-spacing: -.01em; color: var(--as-text); }
.page-head p { margin: .3rem 0 0; color: var(--as-muted); max-width: 78ch; }

/* Count cards: a coloured icon tile, a tone accent and a large figure.
   Tone: .tone-<name> on the card; state classes (border-warning / -danger / -success) override it;
   cards without a tone take one from their position in the row. */
.stat {
  --tone: var(--as-teal); --tone-soft: #e3f1f2; --tone-line: #a9d0d2;
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--as-surface); border: 1px solid var(--as-border); border-radius: 16px;
  padding: 1.05rem 1.15rem 1.1rem; padding-inline-end: 4.6rem; height: 100%; min-height: 104px;
  box-shadow: var(--as-shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.stat::before {
  content: ""; position: absolute; z-index: -1; width: 132px; height: 132px; border-radius: 50%;
  inset-inline-end: -46px; bottom: -64px; background: var(--tone-soft); opacity: .75;
}
.stat::after { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--tone); }
a.stat:hover { transform: translateY(-2px); border-color: var(--tone-line); box-shadow: 0 12px 26px -14px var(--tone); }
a.stat:focus-visible { box-shadow: var(--as-ring); outline: 0; }
.stat-label { color: var(--as-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; line-height: 1.4; }
.stat-label .bi:first-child {
  position: absolute; top: 1rem; inset-inline-end: 1rem; margin: 0 !important;
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.3rem; color: var(--tone); background: var(--tone-soft); box-shadow: inset 0 0 0 1px var(--tone-line);
  transition: background-color .18s ease, color .18s ease;
}
a.stat:hover .stat-label .bi:first-child { background: var(--tone); color: #fff; box-shadow: none; }
.stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1.15; margin-top: .45rem; color: var(--as-text); letter-spacing: -.015em; }
.stat .small { position: relative; }
[dir="rtl"] .stat-label { letter-spacing: 0; }

:where(.row > :nth-child(4n+2)) > .stat { --tone: #2563c9; --tone-soft: #e8effc; --tone-line: #b9cdf2; }
:where(.row > :nth-child(4n+3)) > .stat { --tone: #6d4bd8; --tone-soft: #efebfd; --tone-line: #cfc3f6; }
:where(.row > :nth-child(4n+4)) > .stat { --tone: #008752; --tone-soft: #e2f5ec; --tone-line: #a6dcc1; }
.stat.tone-teal   { --tone: #0a6f78; --tone-soft: #e3f1f2; --tone-line: #a9d0d2; }
.stat.tone-green  { --tone: #008752; --tone-soft: #e2f5ec; --tone-line: #a6dcc1; }
.stat.tone-blue   { --tone: #2563c9; --tone-soft: #e8effc; --tone-line: #b9cdf2; }
.stat.tone-sky    { --tone: #0b7fb5; --tone-soft: #e3f3fb; --tone-line: #a9d6ec; }
.stat.tone-violet { --tone: #6d4bd8; --tone-soft: #efebfd; --tone-line: #cfc3f6; }
.stat.tone-amber  { --tone: #b67f00; --tone-soft: #fff4d6; --tone-line: #f1d488; }
.stat.tone-orange { --tone: #d0571f; --tone-soft: #fdeee5; --tone-line: #f4c3a6; }
.stat.tone-rose   { --tone: #c8323a; --tone-soft: #fde8e9; --tone-line: #f3b9bc; }
.stat.tone-slate  { --tone: #4f6a70; --tone-soft: #eef2f3; --tone-line: #c8d4d6; }
/* Live state beats the card's own colour */
.stat.border-success { --tone: #008752; --tone-soft: #e2f5ec; --tone-line: #a6dcc1; border-color: #a6dcc1 !important; }
.stat.border-warning { --tone: #b67f00; --tone-soft: #fff4d6; --tone-line: #f1d488; border-color: #f1d488 !important; background: linear-gradient(180deg, #fffbf0 0%, #fff 65%); }
.stat.border-danger  { --tone: #c8323a; --tone-soft: #fde8e9; --tone-line: #f3b9bc; border-color: #f3b9bc !important; background: linear-gradient(180deg, #fff6f6 0%, #fff 65%); }
.section-title { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--as-muted); margin: 0 0 .75rem; }
.section-title .bi { color: var(--as-green-600); font-size: 1rem; }

/* Tables */
.table { --bs-table-bg: transparent; --bs-table-color: var(--as-text); --bs-table-border-color: var(--as-border); --bs-table-striped-bg: var(--as-surface-2); }
.table > thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--as-muted); font-weight: 700; white-space: nowrap;
}
.table-card { background: var(--as-surface); border: 1px solid var(--as-border); border-radius: var(--as-radius); overflow: hidden; box-shadow: var(--as-shadow-sm); }
.table-card .table { margin: 0; }
.table-card .table td, .table-card .table th { padding: .72rem .95rem; vertical-align: middle; }
.table-card .table > thead th { background: var(--as-surface-2); border-bottom-color: var(--as-border); }
.table-card .table:not(.wo-table):not(.qc-form):not(.quote-lines) > tbody > tr:hover > * { --bs-table-bg-state: #f4f9f8; }
.table-card .table > tbody > tr:last-child > * { border-bottom-width: 0; }
.mono { font-family: Consolas, "Cascadia Mono", "Courier New", monospace; font-size: .85em; }
.json-cell { max-width: 340px; white-space: pre-wrap; word-break: break-word; font-size: .78rem; color: var(--as-muted); }

/* Pagination, nav tabs and pills in the brand colour */
.pagination { --bs-pagination-color: var(--as-teal); --bs-pagination-active-bg: var(--as-teal); --bs-pagination-active-border-color: var(--as-teal); --bs-pagination-focus-box-shadow: var(--as-ring); --bs-pagination-border-color: var(--as-border); }
.nav-tabs { --bs-nav-tabs-border-color: var(--as-border); --bs-nav-tabs-link-active-color: var(--as-teal-800); --bs-nav-tabs-link-active-border-color: var(--as-border) var(--as-border) #fff; }
.nav-tabs .nav-link { font-weight: 600; color: var(--as-muted); }
.nav-tabs .nav-link.active { border-top: 3px solid var(--as-green); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--as-teal); }
.nav-pills .nav-link { font-weight: 600; }
.progress { --bs-progress-bar-bg: var(--as-teal); --bs-progress-bg: #e3ebeb; border-radius: 999px; }

/* Badges: soft tinted labels (readable, calm); solid colours are kept for counters only */
.badge { font-weight: 650; letter-spacing: .01em; border-radius: 6px; }
.badge-status { padding: .38em .62em; }
.badge.text-bg-primary   { color: #06464d !important; background-color: #d9eeee !important; box-shadow: inset 0 0 0 1px #b6dadb; }
.badge.text-bg-success   { color: #0b6b42 !important; background-color: #e2f5ea !important; box-shadow: inset 0 0 0 1px #b5e0c7; }
.badge.text-bg-info      { color: #0b5a72 !important; background-color: #e2f2f8 !important; box-shadow: inset 0 0 0 1px #b6dbe8; }
.badge.text-bg-warning   { color: #7a4f00 !important; background-color: #fff3d6 !important; box-shadow: inset 0 0 0 1px #f3d58c; }
.badge.text-bg-danger    { color: #9b1c13 !important; background-color: #fde8e6 !important; box-shadow: inset 0 0 0 1px #f4c1bb; }
.badge.text-bg-secondary { color: #3e5055 !important; background-color: #ebf0f0 !important; box-shadow: inset 0 0 0 1px #d3dddd; }
.badge.text-bg-dark      { color: #fff !important; background-color: #23363b !important; }
.badge.text-bg-light     { color: #5c6d72 !important; background-color: #f4f7f7 !important; box-shadow: inset 0 0 0 1px #dde6e6; }
.badge.rounded-pill { border-radius: 999px; }
.badge-solid { color: #fff !important; background: var(--as-teal) !important; box-shadow: none !important; }

/* =====================================================================
   Alerts: clear callouts with an accent edge and an icon for every type
   ===================================================================== */
.alert {
  --bs-alert-padding-y: .85rem;
  --bs-alert-padding-x: 1rem;
  --bs-alert-border-radius: 10px;
  position: relative;
  padding-inline-start: 2.85rem;
  border-width: 1px; border-inline-start-width: 4px;
  font-size: .9rem; line-height: 1.5;
  box-shadow: var(--as-shadow-sm);
}
.alert::before {
  font-family: "bootstrap-icons"; font-style: normal; font-weight: 400; line-height: 1;
  position: absolute; inset-inline-start: 1rem; top: 1rem; font-size: 1.1rem;
  content: "\f430";
}
.alert:has(> .bi:first-child)::before, .alert.alert-plain::before { content: none; }
.alert:has(> .bi:first-child), .alert.alert-plain { padding-inline-start: 1rem; }
.alert > .bi:first-child { margin-inline-end: .4rem; }
.alert-heading { font-size: .95rem; font-weight: 700; margin-bottom: .25rem; }
.alert .alert-link { font-weight: 700; }
.alert-success   { --bs-alert-color: #0b5e3a; --bs-alert-bg: #eaf7f0; --bs-alert-border-color: #bfe5cf; --bs-alert-link-color: #084a2d; border-inline-start-color: var(--as-green-600); }
.alert-success::before { content: "\f26a"; color: var(--as-green-600); }
.alert-info      { --bs-alert-color: #0b4d61; --bs-alert-bg: #eaf5f8; --bs-alert-border-color: #c0dfe9; --bs-alert-link-color: #083c4c; border-inline-start-color: #1b87a6; }
.alert-info::before { content: "\f430"; color: #1b87a6; }
.alert-warning   { --bs-alert-color: #6b4600; --bs-alert-bg: #fff8e6; --bs-alert-border-color: #f3dca0; --bs-alert-link-color: #553700; border-inline-start-color: var(--as-amber); }
.alert-warning::before { content: "\f33a"; color: #d18f00; }
.alert-danger    { --bs-alert-color: #8c1d14; --bs-alert-bg: #fdeeec; --bs-alert-border-color: #f3c6c0; --bs-alert-link-color: #6e160f; border-inline-start-color: #d92d20; }
.alert-danger::before { content: "\f336"; color: #d92d20; }
.alert-secondary, .alert-light {
  --bs-alert-color: #34474c; --bs-alert-bg: #f5f8f8; --bs-alert-border-color: #dde6e6; --bs-alert-link-color: var(--as-teal-800);
  border-inline-start-color: #9fb3b4;
}
.alert-secondary::before, .alert-light::before { content: "\f431"; color: #6e8488; }
.alert-primary   { --bs-alert-color: #06464d; --bs-alert-bg: var(--as-teal-50); --bs-alert-border-color: #c4e0e1; border-inline-start-color: var(--as-teal); }
.alert-primary::before { color: var(--as-teal); }
.alert-dark      { --bs-alert-color: #eaf3f2; --bs-alert-bg: #12353b; --bs-alert-border-color: #12353b; --bs-alert-link-color: #fff; border-inline-start-color: var(--as-green); }
.alert-dark::before { color: #35d494; }
.alert-dismissible { padding-inline-end: 3rem; }

/* Flash message (after an action): bigger icon, the message, close */
.as-flash { display: flex; align-items: flex-start; gap: .75rem; padding-inline-start: 1rem; animation: as-drop .25s ease-out; }
.as-flash::before { content: none; }
.as-flash > .bi { font-size: 1.2rem; line-height: 1.2; margin: 0; }
.as-flash.alert-success > .bi { color: var(--as-green-600); }
.as-flash.alert-info > .bi { color: #1b87a6; }
.as-flash.alert-warning > .bi { color: #d18f00; }
.as-flash.alert-danger > .bi { color: #d92d20; }
.as-flash-title { font-weight: 700; display: block; margin-bottom: .1rem; }
@keyframes as-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Page instruction guide (one per page, "How this page works")
   ===================================================================== */
.as-guide {
  position: relative;
  background: linear-gradient(180deg, #f1f9f7 0%, #fbfdfd 100%);
  border: 1px solid #cfe5e1; border-radius: var(--as-radius);
  margin-bottom: 1.35rem; box-shadow: var(--as-shadow-sm); overflow: hidden;
}
.as-guide::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--as-grad); }
.as-guide > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .8rem 1.1rem .8rem 1.25rem;
}
.as-guide > summary::-webkit-details-marker { display: none; }
.as-guide > summary:focus-visible { outline: 0; box-shadow: inset var(--as-ring); }
.as-guide-icon {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
  display: grid; place-items: center; background: var(--as-grad); color: #fff; font-size: 1rem;
  box-shadow: 0 3px 8px rgba(0, 135, 82, .25);
}
.as-guide-head { flex: 1 1 260px; min-width: 0; }
.as-guide-kicker { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--as-green-600); }
.as-guide-title { font-weight: 700; color: var(--as-text); font-size: .98rem; }
.as-guide-who { display: flex; flex-wrap: wrap; gap: .35rem; }
.as-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: #fff; color: #2a5b5f; border: 1px solid #c7dfdd; white-space: nowrap;
}
.as-chip .bi { color: var(--as-green-600); }
.as-guide-toggle { color: var(--as-muted); font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; }
.as-guide-toggle .bi { transition: transform .2s ease; }
.as-guide[open] .as-guide-toggle .bi { transform: rotate(180deg); }
.as-guide .when-open { display: none; }
.as-guide[open] .when-open { display: inline; }
.as-guide[open] .when-closed { display: none; }
.as-guide-steps {
  list-style: none; margin: 0; padding: .2rem 1.1rem 1.05rem 1.25rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem;
  counter-reset: as-step;
}
.as-guide-steps li {
  counter-increment: as-step; position: relative;
  background: #fff; border: 1px solid var(--as-border); border-radius: 10px;
  padding: .7rem .85rem .75rem 2.75rem; font-size: .86rem; color: #2a3d42; line-height: 1.45;
}
[dir="rtl"] .as-guide-steps li { padding: .7rem 2.75rem .75rem .85rem; }
.as-guide-steps li::before {
  content: counter(as-step); position: absolute; inset-inline-start: .75rem; top: .68rem;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: .75rem; font-weight: 800;
  background: var(--as-teal-50); color: var(--as-teal); border: 1px solid #bfdcdd;
}

/* =====================================================================
   Dashboard: welcome banner and the two vertical timelines
   ===================================================================== */
.as-hero {
  position: relative; overflow: hidden;
  border-radius: 16px; padding: 1.5rem 1.6rem; margin-bottom: 1.5rem;
  background: var(--as-grad-ink); color: #eaf5f3;
  box-shadow: 0 12px 30px rgba(5, 34, 39, .22);
}
.as-hero::after {
  content: ""; position: absolute; inset-inline-end: -40px; top: -60px; width: 300px; height: 300px;
  background: url("../img/logo-mark.png") center / contain no-repeat; opacity: .1; pointer-events: none;
}
[dir="rtl"] .as-hero::after { transform: scaleX(-1); }
.as-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 220px at 85% 120%, rgba(0, 168, 104, .35), transparent 70%);
}
.as-hero > * { position: relative; z-index: 1; }
.as-hero-eyebrow { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #7fe0b5; }
.as-hero h2 { font-size: 1.6rem; font-weight: 750; margin: .25rem 0 .55rem; color: #fff; letter-spacing: -.01em; }
.as-hero-meta { display: flex; flex-wrap: wrap; gap: .45rem; }
.as-hero-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: rgba(255,255,255,.1); color: #e3f3f0; border: 1px solid rgba(255,255,255,.16);
}
.as-hero-chip .bi { color: #7fe0b5; }
.as-hero-chip.is-warn { background: rgba(242, 169, 0, .18); border-color: rgba(242, 169, 0, .45); color: #ffe7a8; }
.as-hero-focus {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 14px;
  padding: .9rem 1.1rem; min-width: 210px; text-align: center;
}
.as-hero-focus-num { font-size: 2.2rem; font-weight: 800; line-height: 1; color: #fff; }
.as-hero-focus-label { font-size: .78rem; color: #bfe0da; margin-top: .3rem; }
.as-hero-focus.is-clear .as-hero-focus-num { color: #7fe0b5; }

/* Workflow timeline: the whole process top to bottom, the signed-in user's steps highlighted */
.as-flow-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.as-timeline { list-style: none; margin: 0; padding: .35rem 0 0; position: relative; }
.as-tl-item { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: .9rem; padding-bottom: 1rem; }
.as-tl-item:last-child { padding-bottom: 0; }
.as-tl-item::before {
  content: ""; position: absolute; inset-inline-start: 21px; top: 44px; bottom: 0; width: 2px;
  background: repeating-linear-gradient(180deg, #cfdcdc 0 6px, transparent 6px 11px);
}
.as-tl-item:last-child::before { display: none; }
.as-tl-item.is-done::before, .as-tl-item.is-action::before { background: linear-gradient(180deg, #8fd3b4, #cfdcdc); }
.as-tl-marker {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
  background: #fff; color: #7f9295; border: 2px solid #d3dfdf; z-index: 1;
}
.as-tl-marker .bi { font-size: 1.15rem; }
.as-tl-item.is-clear .as-tl-marker { background: var(--as-green-50); color: var(--as-green-600); border-color: #9fd9bb; }
.as-tl-item.is-open .as-tl-marker, .as-tl-item.is-progress .as-tl-marker { background: var(--as-teal-50); color: var(--as-teal); border-color: #a9d0d2; }
.as-tl-item.is-progress .as-tl-card { border-color: #b9d8da; }
.as-tl-item.is-progress::before, .as-tl-item.is-open::before, .as-tl-item.is-clear::before { background: linear-gradient(180deg, #a9d0d2, #cfdcdc); }
.as-tl-item.is-action .as-tl-marker {
  background: var(--as-grad); color: #fff; border-color: transparent;
  box-shadow: 0 0 0 5px rgba(0, 168, 104, .16), 0 4px 12px rgba(0, 112, 120, .3);
  animation: as-pulse 2.2s ease-in-out infinite;
}
@keyframes as-pulse { 0%, 100% { box-shadow: 0 0 0 5px rgba(0, 168, 104, .16), 0 4px 12px rgba(0, 112, 120, .3); } 50% { box-shadow: 0 0 0 9px rgba(0, 168, 104, .06), 0 4px 12px rgba(0, 112, 120, .3); } }
@media (prefers-reduced-motion: reduce) { .as-tl-item.is-action .as-tl-marker { animation: none; } }
.as-tl-card {
  background: #fff; border: 1px solid var(--as-border); border-radius: 12px;
  padding: .8rem 1rem .85rem; box-shadow: var(--as-shadow-sm); min-width: 0;
}
.as-tl-item.is-action .as-tl-card { border-color: #9fd9bb; box-shadow: 0 4px 16px rgba(0, 135, 82, .1); }
.as-tl-item.is-other .as-tl-card { background: var(--as-surface-2); box-shadow: none; border-style: dashed; }
.as-tl-item.is-other .as-tl-title { color: #4d5f63; }
.as-tl-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.as-tl-title { font-weight: 700; font-size: .95rem; color: var(--as-text); margin: 0; }
.as-tl-desc { font-size: .84rem; color: var(--as-muted); margin: .25rem 0 0; }
.as-tl-who { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; color: #4d6a6d; background: #eef4f4; border-radius: 999px; padding: .15rem .55rem; }
.as-tl-who .bi { color: #6e8a8d; }
.as-tl-mine { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--as-grad); border-radius: 999px; padding: .18rem .55rem; }
.as-tl-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .65rem; }
.as-tl-count { display: inline-flex; align-items: baseline; gap: .35rem; font-size: .84rem; color: var(--as-muted); }
.as-tl-count strong { font-size: 1.35rem; color: var(--as-text); font-weight: 800; line-height: 1; }
.as-tl-item.is-action .as-tl-count strong { color: var(--as-teal); }
.as-tl-ok { font-size: .82rem; font-weight: 600; color: var(--as-green-600); display: inline-flex; align-items: center; gap: .3rem; }

[dir="rtl"] .flip-rtl { display: inline-block; transform: scaleX(-1); }

/* Recent activity timeline (the signed-in user's own sign-ins and actions) */
.as-activity { list-style: none; margin: 0; padding: 0; position: relative; }
.as-activity::before { content: ""; position: absolute; inset-inline-start: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--as-border); }
.as-act-day { position: relative; padding: .5rem 0 .35rem 2.6rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--as-muted); }
[dir="rtl"] .as-act-day { padding: .5rem 2.6rem .35rem 0; }
.as-act { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: .65rem; padding: .35rem 0; }
.as-act-dot {
  width: 32px; height: 32px; border-radius: 50%; z-index: 1;
  display: grid; place-items: center; font-size: .85rem;
  background: #fff; color: var(--as-teal); border: 2px solid var(--as-teal-100);
}
.as-act.is-auth .as-act-dot { color: var(--as-green-600); border-color: #c6e8d6; background: var(--as-green-50); }
.as-act.is-warn .as-act-dot { color: #b42318; border-color: #f4c1bb; background: #fdeeec; }
.as-act-body { min-width: 0; padding-top: .2rem; }
.as-act-title { font-size: .86rem; font-weight: 600; color: var(--as-text); line-height: 1.35; }
.as-act-title a { color: inherit; text-decoration: none; }
.as-act-title a:hover { color: var(--as-teal); text-decoration: underline; }
.as-act-time { font-size: .74rem; color: var(--as-muted); }

@media (min-width: 1200px) { .as-sticky { position: sticky; top: 84px; } }

/* Quick links on the dashboard */
.as-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .55rem; }
.as-quick a {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 10px;
  border: 1px solid var(--as-border); background: #fff; color: var(--as-text); font-size: .86rem; font-weight: 600; text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.as-quick a:hover { border-color: #9fcfd1; background: var(--as-teal-50); transform: translateY(-1px); }
.as-quick a .bi { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: grid; place-items: center; background: var(--as-teal-50); color: var(--as-teal); }
.as-quick a.is-main { background: var(--as-grad); color: #fff; border-color: transparent; }
.as-quick a.is-main .bi { background: rgba(255,255,255,.18); color: #fff; }

.as-empty { text-align: center; color: var(--as-muted); padding: 1.25rem .5rem; font-size: .88rem; }
.as-empty .bi { display: block; font-size: 1.6rem; color: #a9bcbd; margin-bottom: .35rem; }

/* List tables: quick filter, column filters, sorting and Excel export (assets/js/table.js) */
.dt-shell { background: var(--as-surface); border: 1px solid var(--as-border); border-radius: var(--as-radius); box-shadow: var(--as-shadow-sm); overflow: hidden; }
.dt-shell > .table-card { border: 0; border-radius: 0; box-shadow: none; }
.dt-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .7rem .85rem; border-bottom: 1px solid var(--as-border); background: linear-gradient(180deg, #fbfdfd 0%, #f4f8f8 100%);
}
.dt-search { position: relative; flex: 1 1 240px; max-width: 380px; }
.dt-search .bi { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: .75rem; color: var(--as-muted); font-size: .85rem; pointer-events: none; }
.dt-search .form-control { padding-inline-start: 2.05rem; border-radius: 999px; background: #fff; }
.dt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.dt-count { font-size: .8rem; font-weight: 600; color: var(--as-muted); margin-inline-end: .25rem; }
.dt-clear { font-size: .8rem; color: #b42318; text-decoration: none; }
.dt-clear:hover { color: #8f1c13; }
.dt-toggle.is-on { background: var(--as-teal-50); border-color: #a9d0d2; color: var(--as-teal-700); }
.dt-excel {
  --bs-btn-color: #fff; --bs-btn-bg: #1d6f42; --bs-btn-border-color: #1d6f42;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #185c37; --bs-btn-hover-border-color: #185c37;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #134a2c; --bs-btn-active-border-color: #134a2c;
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #9cc2ad; --bs-btn-disabled-border-color: #9cc2ad;
}
.table > thead .dt-filter-row th {
  padding: .4rem .5rem; background: var(--as-surface); border-bottom: 1px solid var(--as-border);
  text-transform: none; letter-spacing: 0; font-weight: 400;
}
.dt-filter-row .form-control, .dt-filter-row .form-select { width: 100%; min-width: 72px; max-width: 14rem; font-size: .78rem; padding-top: .22rem; padding-bottom: .22rem; border-radius: 8px; background-color: #fff; text-transform: none; }
.dt-filter-row .form-control { padding-inline: .5rem; }
.dt-sort {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; border-radius: 4px;
}
.dt-sort:hover { color: var(--as-teal-700); }
.dt-sort:focus-visible { outline: 2px solid var(--as-teal); outline-offset: 2px; }
.dt-sort-icon { font-size: .74rem; opacity: .35; transition: opacity .15s ease; }
.dt-sort:hover .dt-sort-icon { opacity: .7; }
.dt-sorted .dt-sort { color: var(--as-teal-700); }
.dt-sorted .dt-sort-icon { opacity: 1; }
@media print { .dt-toolbar, .dt-filter-row { display: none !important; } .dt-shell { border: 0; box-shadow: none; } }

/* "Items waiting for you" box in the hero: opens the My workflow window */
button.as-hero-focus { display: block; width: 100%; color: inherit; font: inherit; cursor: pointer; transition: background-color .15s ease, transform .15s ease; }
button.as-hero-focus:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
button.as-hero-focus:focus-visible { outline: 3px solid #7fe0b5; outline-offset: 3px; }
.as-hero-focus-cta {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: .6rem; padding: .28rem .75rem; border-radius: 999px;
  background: #fff; color: var(--as-teal-800); font-size: .76rem; font-weight: 700;
}

/* My workflow window */
.modal-backdrop { --bs-backdrop-bg: #052227; --bs-backdrop-opacity: .55; }
.as-workflow-modal .modal-content { border: 0; border-radius: 18px; box-shadow: 0 24px 60px rgba(5, 34, 39, .28); overflow: hidden; }
.as-workflow-modal .modal-header { background: var(--as-surface-2); border-bottom-color: var(--as-border); padding: .9rem 1.25rem; }
.as-workflow-modal .modal-title { font-weight: 750; display: flex; align-items: center; }
.as-workflow-modal .modal-title .bi { color: var(--as-teal); }
.as-workflow-modal .modal-body { padding: 1.1rem 1.25rem 1.35rem; }

/* Project board: ongoing projects with their progress, filtered by today / this week / waiting / overdue / status */
.as-projects { scroll-margin-top: 84px; }
.as-card-title { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1rem; font-weight: 750; color: var(--as-text); }
.as-card-title .bi { color: var(--as-teal); }
.as-card-title .badge { font-size: .72rem; }
.as-proj-status { display: flex; align-items: center; gap: .5rem; }
.as-proj-status label { font-size: .78rem; font-weight: 600; color: var(--as-muted); white-space: nowrap; }
.as-proj-status .form-select { min-width: 200px; }
.as-proj-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.as-proj-filter {
  display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .8rem; border-radius: 999px;
  border: 1px solid var(--as-border); background: #fff; color: #33494d; font-size: .82rem; font-weight: 600; text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.as-proj-filter:hover { border-color: #9fcfd1; background: var(--as-teal-50); color: var(--as-teal-700); }
.as-proj-filter.is-active { background: var(--as-teal); border-color: var(--as-teal); color: #fff; }
.as-proj-filter-count { min-width: 1.45rem; padding: .05rem .42rem; border-radius: 999px; background: var(--as-surface-2); color: #33494d; font-size: .72rem; font-weight: 700; text-align: center; }
.as-proj-filter.is-warn .as-proj-filter-count { background: #fff1c7; color: #6b4600; }
.as-proj-filter.is-alert .as-proj-filter-count { background: #fde3e3; color: #a3261c; }
.as-proj-filter.is-active .as-proj-filter-count { background: rgba(255,255,255,.22); color: #fff; }

.as-proj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.as-proj {
  border: 1px solid var(--as-border); border-radius: 14px; background: #fff; padding: .9rem 1rem .85rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.as-proj:hover { border-color: #b9d8da; box-shadow: 0 4px 14px rgba(6, 70, 77, .06); }
.as-proj.is-mine { border-color: #9fd9bb; border-inline-start: 4px solid var(--as-green); box-shadow: 0 4px 16px rgba(0, 135, 82, .08); }
.as-proj.is-overdue { border-inline-start: 4px solid #d64545; }
.as-proj.is-stage-cancelled { background: var(--as-surface-2); }
.as-proj-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.as-proj-name { display: flex; flex-direction: column; min-width: 0; }
.as-proj-no { font-size: 1rem; font-weight: 800; color: var(--as-ink-900, #052227); }
.as-proj-client { font-size: .84rem; color: var(--as-muted); overflow-wrap: anywhere; }
.as-proj-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }

.as-track { list-style: none; margin: .85rem 0 .75rem; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.as-track-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; min-width: 0; }
.as-track-step::before {
  content: ""; position: absolute; top: 13px; height: 3px; border-radius: 3px; background: #dde7e7;
  inset-inline-start: calc(-50% + 17px); inset-inline-end: calc(50% + 17px);
}
.as-track-step:first-child::before { display: none; }
.as-track-step.is-done::before, .as-track-step.is-current::before, .as-track-step.is-hold::before { background: #8fd3b4; }
.as-track-dot {
  position: relative; z-index: 1; width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid #d3dfdf; color: #8aa0a3; font-size: .8rem;
}
.as-track-step.is-done .as-track-dot { background: var(--as-green); border-color: var(--as-green); color: #fff; }
.as-track-step.is-current .as-track-dot { background: var(--as-teal); border-color: var(--as-teal); color: #fff; box-shadow: 0 0 0 4px rgba(10, 111, 120, .14); }
.as-proj.is-mine .as-track-step.is-current .as-track-dot { background: var(--as-grad); border-color: transparent; animation: as-pulse 2.4s ease-in-out infinite; }
.as-track-step.is-hold .as-track-dot { background: var(--as-amber); border-color: var(--as-amber); color: #3b2a00; }
.as-track-label { font-size: .72rem; font-weight: 600; line-height: 1.2; color: #7b8f92; overflow-wrap: anywhere; }
.as-track-step.is-done .as-track-label { color: var(--as-green-600); }
.as-track-step.is-current .as-track-label { color: var(--as-teal-700); font-weight: 800; }
.as-track-step.is-hold .as-track-label { color: var(--as-amber-dark); font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .as-proj.is-mine .as-track-step.is-current .as-track-dot { animation: none; } }
@media (max-width: 575.98px) { .as-track-label { font-size: .64rem; } .as-track-dot { width: 25px; height: 25px; } .as-track-step::before { top: 11px; } }

.as-proj-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; padding-top: .65rem; border-top: 1px dashed var(--as-border); }
.as-proj-meta { display: flex; flex-wrap: wrap; gap: .45rem 1.5rem; margin: 0; }
.as-proj-meta dt { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #7b8f92; }
.as-proj-meta dd { margin: 0; font-size: .85rem; font-weight: 600; color: var(--as-text); }
.as-proj-meta dd.is-late { color: #b42318; }
[dir="rtl"] .as-proj-meta dt, [dir="rtl"] .as-tl-mine { letter-spacing: 0; }
.as-proj-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; }
.as-proj-pager .pagination { margin: 0; }

/* =====================================================================
   Module-specific components (unchanged behaviour, brand colours)
   ===================================================================== */
.secret-box {
  font-family: Consolas, "Courier New", monospace; font-size: 1.15rem; letter-spacing: .08em;
  background: var(--as-surface-2); border: 1px dashed var(--as-teal); border-radius: 8px;
  padding: .75rem 1rem; word-break: break-all;
}
.recovery-codes { columns: 2; font-family: Consolas, "Courier New", monospace; font-size: 1rem; }

.role-group { border: 1px solid var(--as-border); border-radius: 10px; padding: .75rem 1rem; margin-bottom: .75rem; background: #fff; }
.role-group-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--as-muted); font-weight: 700; margin-bottom: .4rem; }

/* Quotations */
.quote-lines .w-40 { width: 40%; }
.quote-lines textarea { min-width: 220px; }
.quote-lines input { min-width: 70px; }
.quote-totals td { padding: .1rem 0; }
.approval-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.approval-step { border: 1px solid var(--as-border); border-radius: 10px; padding: .65rem .8rem; background: var(--as-surface); border-top: 4px solid var(--as-border); }
.approval-step.done { border-top-color: var(--as-green); }
.approval-step.returned { border-top-color: #d92d20; }
.approval-step.current { border-top-color: var(--as-amber); box-shadow: 0 0 0 2px rgba(242, 169, 0, .25); }
.approval-step.held { border-top-color: #6c757d; }

/* Production floor board: one column per stage, scrolls sideways on small screens */
.floor-board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.floor-col { flex: 0 0 250px; background: #e9f0f0; border-radius: 10px; padding: .55rem; }
.floor-card { background: #fff; border: 1px solid var(--as-border); border-inline-start-width: 4px; border-radius: 8px; padding: .5rem .6rem; margin-bottom: .5rem; font-size: .85rem; box-shadow: var(--as-shadow-sm); }
.floor-card.is-late { border-inline-start-color: #d92d20; }
.floor-card.is-held { border-inline-start-color: var(--as-amber); }
.floor-card.is-running { border-inline-start-color: var(--as-teal); }
.stage-step { border: 1px solid var(--as-border); border-radius: 10px; padding: .6rem .75rem; margin-bottom: .5rem; background: #fff; }
.stage-step.is-current { border-color: var(--as-teal); box-shadow: 0 0 0 .15rem rgba(10, 111, 120, .15); }

/* Public certificate verification page */
.verify-page { max-width: 640px; }
/* Public inspection request form */
.public-page { max-width: 860px; }
/* Client inspection portal */
.ip-progress { width: 80px; height: 8px; vertical-align: middle; }

/* Client portal: order tracker (compact dots in lists; the full view reuses .approval-steps) */
.order-track { display: inline-flex; gap: 3px; vertical-align: middle; }
.order-track span { width: 18px; height: 6px; border-radius: 3px; background: var(--as-border); }
.order-track span.done { background: var(--as-green); }
.order-track span.current { background: var(--as-amber); }
.order-track span.held { background: #6c757d; }

/* Work order form (FM:PD:01): plain Word-style table - normal-case bold headings, fixed column proportions */
.wo-table th, .table.wo-table > thead th { text-transform: none; letter-spacing: normal; font-size: inherit; color: var(--bs-body-color); background: transparent; white-space: normal; }
.wo-table tbody th[scope="row"] { font-weight: 400; width: 21%; }
.wo-lines { table-layout: fixed; min-width: 760px; }
.wo-lines thead th { font-weight: 700; }

/* Public pages: language switch */
.public-lang { position: absolute; top: .5rem; inset-inline-end: .75rem; }

/* Right-to-left: serials, numbers and codes always read left to right */
[dir="rtl"] .mono { direction: ltr; unicode-bidi: isolate; }

/* Signature image preview (Admin > Users, quotation signature card) */
.signature-preview { max-height: 90px; max-width: 280px; object-fit: contain; }

/* QC checklist (FM:QC:02): plain headings like the paper form, narrow Yes / No / N/A columns */
.qc-form th, .table.qc-form > thead th { text-transform: none; letter-spacing: normal; font-size: inherit; color: var(--bs-body-color); white-space: normal; background: transparent; }
.qc-form .qc-answer { width: 3.25rem; min-width: 3.25rem; }

/* =====================================================================
   Sign-in pages: brand panel + form card
   ===================================================================== */
.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--as-bg);
}
.auth-brand-panel {
  position: relative; overflow: hidden; color: #e3f3f0;
  background: var(--as-grad-ink);
  padding: 3rem 3.25rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
}
.auth-brand-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 320px at 100% 110%, rgba(0, 168, 104, .38), transparent 70%),
    radial-gradient(420px 260px at -10% -10%, rgba(10, 111, 120, .45), transparent 70%);
}
.auth-brand-panel::after {
  content: ""; position: absolute; inset-inline-end: -90px; bottom: -70px; width: 420px; height: 420px;
  background: url("../img/logo-mark.png") center / contain no-repeat; opacity: .09; pointer-events: none;
}
.auth-brand-panel > * { position: relative; z-index: 1; }
.auth-brand-top { display: flex; align-items: center; gap: .85rem; }
.auth-brand-top img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0, 168, 104, .45)); }
.auth-brand-top .name { font-weight: 800; font-size: 1.45rem; color: #fff; line-height: 1.1; letter-spacing: .01em; }
.auth-brand-top .sub { font-size: .8rem; color: #9cc6c0; }
.auth-brand-panel h1 { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1.2; margin: 0 0 .6rem; letter-spacing: -.015em; max-width: 18ch; }
.auth-brand-panel .lead { font-size: 1rem; color: #bfe0da; max-width: 46ch; }
html[dir="ltr"] .auth-ar, html[dir="ltr"] .app-sidebar-foot .ar { text-align: left; }
.auth-ar { font-family: "Noto Naskh Arabic", Tahoma, "Segoe UI", sans-serif; font-size: 1.35rem; font-weight: 700; color: #7fe0b5; margin-bottom: .2rem; }
.auth-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .7rem; }
.auth-points li { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; color: #d6ece8; }
.auth-points .bi { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #7fe0b5; }
.auth-brand-foot { font-size: .76rem; color: #86aaa6; }
.auth-form-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; position: relative; }
.auth-card { width: 100%; max-width: 420px; border: 1px solid var(--as-border); border-radius: 16px; box-shadow: 0 20px 50px rgba(5, 34, 39, .1); }
.auth-card .card-body { padding: 2.1rem 2.1rem 2rem; }
.auth-logo { display: block; width: 116px; height: auto; margin: 0 auto 1.25rem; }
.auth-card h2 { text-align: center; font-weight: 750; }
.auth-foot { color: var(--as-muted); font-size: .76rem; text-align: center; margin-top: 1.25rem; max-width: 420px; }
.auth-lang { position: absolute; top: 1rem; inset-inline-end: 1rem; z-index: 2; }
/* Kept for older markup */
.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.5rem; }
.auth-brand-name { font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.auth-brand-sub { font-size: .8rem; color: var(--as-muted); }
@media (max-width: 991.98px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand-panel { padding: 1.5rem 1.25rem; gap: 1rem; }
  .auth-brand-panel h1, .auth-brand-panel .lead, .auth-points, .auth-brand-foot { display: none; }
  .auth-form-panel { padding: 1rem 1rem 2rem; }
  .auth-lang { position: static; align-self: flex-end; margin-bottom: .75rem; }
}

/* Error page */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.error-box { max-width: 460px; }
.error-code { font-size: 4rem; font-weight: 800; line-height: 1; background: var(--as-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Print: only the document */
@media print {
  .app-sidebar, .app-topbar, .app-footer, .as-guide, .sidebar-toggle { display: none !important; }
  .app-content { padding: 0; }
  body { background: #fff; }
  .card, .table-card, .stat { box-shadow: none; }
}

/* =====================================================================
   Products: summary filter cards, list/grid switch, picture cards
   ===================================================================== */
.stat.is-current { border-color: var(--tone-line); box-shadow: 0 0 0 2px var(--tone-line), var(--as-shadow-sm); }

.as-view-switch { display: inline-flex; padding: 3px; gap: 2px; background: var(--as-surface); border: 1px solid var(--as-border); border-radius: 10px; box-shadow: var(--as-shadow-sm); }
.as-view-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 7px; color: var(--as-muted); font-weight: 600; font-size: .85rem; text-decoration: none; }
.as-view-btn:hover { color: var(--as-teal); background: var(--as-teal-50); }
.as-view-btn.active { color: #fff; background: var(--as-grad-btn); box-shadow: 0 2px 8px -2px rgba(10, 111, 120, .5); }
.as-view-btn:focus-visible { outline: 0; box-shadow: var(--as-ring); }

.as-prod-card {
  position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--as-surface); border: 1px solid var(--as-border); border-radius: var(--as-radius); box-shadow: var(--as-shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.as-prod-card:hover, .as-prod-card:focus-within { transform: translateY(-3px); border-color: #a9d0d2; box-shadow: 0 14px 30px -16px rgba(10, 111, 120, .55); }
.as-prod-media { position: relative; aspect-ratio: 4 / 3; background: #eef4f4; overflow: hidden; }
.as-prod-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.as-prod-card:hover .as-prod-media img { transform: scale(1.04); }
.as-prod-noimg {
  position: absolute; inset-inline: 0; bottom: .65rem; margin-inline: auto; width: max-content;
  padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 600; color: #4f6a70; background: rgba(255, 255, 255, .85); border: 1px solid var(--as-border);
}
.as-prod-family {
  position: absolute; top: .6rem; inset-inline-start: .6rem; padding: .22rem .6rem; border-radius: 999px;
  font-size: .7rem; font-weight: 700; letter-spacing: .02em; color: #fff; background: rgba(5, 34, 39, .72); backdrop-filter: blur(4px);
}
.as-prod-state { position: absolute; top: .6rem; inset-inline-end: .6rem; }
.as-prod-card.is-inactive .as-prod-media img { filter: grayscale(1); opacity: .7; }
.as-prod-body { padding: .85rem 1rem .6rem; flex: 1; }
.as-prod-code { font-size: .74rem; color: var(--as-teal); font-weight: 600; letter-spacing: .02em; }
.as-prod-name { font-size: .98rem; font-weight: 700; line-height: 1.3; margin: .2rem 0 .15rem; }
.as-prod-name a { color: var(--as-text); text-decoration: none; }
.as-prod-name a:hover { color: var(--as-teal); }
.as-prod-name a:focus-visible { outline: 0; }
.as-prod-name a:focus-visible::after { box-shadow: var(--as-ring); border-radius: var(--as-radius); }
.as-prod-ar { font-size: .84rem; color: var(--as-muted); }
.as-prod-specs { margin: .65rem 0 0; padding: .2rem .6rem; background: var(--as-surface-2); border: 1px solid #e7eeee; border-radius: var(--as-radius-sm); }
.as-prod-specs > div { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding: .22rem 0; border-bottom: 1px dashed #e1e9e9; }
.as-prod-specs > div:last-child { border-bottom: 0; }
.as-prod-specs dt { font-size: .76rem; font-weight: 500; color: var(--as-muted); }
.as-prod-specs dd { margin: 0; font-size: .8rem; font-weight: 700; text-align: end; }
.as-prod-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem 1rem; border-top: 1px solid #edf2f2; background: var(--as-surface-2); }
.as-prod-bom { font-size: .78rem; font-weight: 600; }
.as-prod-bom.ok { color: var(--as-green-600); }
.as-prod-bom.missing { color: var(--as-amber-dark); }
.as-prod-edit { position: relative; z-index: 2; }

.as-thumb-col { width: 64px; }
.as-thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--as-border); background: #eef4f4; display: block; }

.as-prod-photo { overflow: hidden; }
.as-prod-photo .as-prod-media { border-bottom: 1px solid var(--as-border); }
.as-spec-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.as-spec-chip { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .75rem .45rem .5rem; border-radius: 10px; background: var(--as-teal-50); border: 1px solid #cfe5e6; font-weight: 700; font-size: .9rem; }
.as-spec-chip > .bi { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #fff; color: var(--as-teal); box-shadow: inset 0 0 0 1px #cfe5e6; }
.as-spec-chip small { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--as-muted); line-height: 1.2; }
.as-image-preview { width: 160px; height: 120px; object-fit: cover; border-radius: var(--as-radius-sm); border: 1px solid var(--as-border); background: #eef4f4; }
.as-image-field { min-width: 240px; }

/* =====================================================================
   Certificate page: summary banner, figures, traceability, life cycle
   ===================================================================== */
.as-cert-hero {
  --tone: #008752; --tone-soft: #e2f5ec; --tone-line: #a6dcc1;
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr minmax(240px, 300px); gap: 1.25rem; align-items: center;
  padding: 1.25rem 1.4rem; background: var(--as-surface); border: 1px solid var(--as-border); border-radius: var(--as-radius); box-shadow: var(--as-shadow-sm);
}
.as-cert-hero::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--tone); }
.as-cert-hero.tone-green  { --tone: #008752; --tone-soft: #e2f5ec; --tone-line: #a6dcc1; }
.as-cert-hero.tone-amber  { --tone: #b67f00; --tone-soft: #fff4d6; --tone-line: #f1d488; }
.as-cert-hero.tone-orange { --tone: #d0571f; --tone-soft: #fdeee5; --tone-line: #f4c3a6; }
.as-cert-hero.tone-rose   { --tone: #c8323a; --tone-soft: #fde8e9; --tone-line: #f3b9bc; }
.as-cert-seal { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; font-size: 2rem; color: var(--tone); background: var(--tone-soft); box-shadow: inset 0 0 0 1px var(--tone-line); }
.as-cert-eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--tone); }
.as-cert-desc { font-size: 1.08rem; font-weight: 700; line-height: 1.35; margin: .2rem 0 .45rem; }
.as-cert-client { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .9rem; }
.as-cert-client .bi { color: var(--as-muted); }
.as-cert-client a { font-weight: 600; }
.as-cert-validity { padding: .85rem 1rem; border-radius: 10px; background: var(--tone-soft); border: 1px solid var(--tone-line); }
.as-cert-validity-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--as-muted); }
.as-cert-validity-big { font-size: 1.35rem; font-weight: 800; color: var(--tone); line-height: 1.2; margin-top: .1rem; }
.as-cert-validity-sub { font-size: .84rem; font-weight: 600; margin-bottom: .55rem; }
.as-cert-progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .85); -webkit-appearance: none; appearance: none; }
.as-cert-progress::-webkit-progress-bar { background: rgba(255, 255, 255, .85); border-radius: 99px; }
.as-cert-progress::-webkit-progress-value { background: var(--tone); border-radius: 99px; }
.as-cert-progress::-moz-progress-bar { background: var(--tone); border-radius: 99px; }
.as-cert-validity-ends { display: flex; justify-content: space-between; gap: .5rem; margin-top: .35rem; font-size: .7rem; color: var(--as-muted); }

.as-spec-tile { height: 100%; display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; background: var(--as-surface); border: 1px solid var(--as-border); border-radius: var(--as-radius); box-shadow: var(--as-shadow-sm); }
.as-spec-tile > .bi { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; font-size: 1.2rem; color: var(--as-teal); background: var(--as-teal-50); box-shadow: inset 0 0 0 1px #cfe5e6; }
.as-spec-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--as-muted); }
.as-spec-value { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.as-spec-note { font-size: .75rem; color: var(--as-muted); }

.as-trace > li { display: grid; grid-template-columns: 34px minmax(110px, 34%) 1fr; align-items: center; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid #edf2f2; font-size: .9rem; }
.as-trace > li:last-child { border-bottom: 0; }
.as-trace > li > .bi { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--as-teal); background: var(--as-teal-50); }
.as-trace-label { color: var(--as-muted); font-size: .8rem; font-weight: 600; }
.as-trace-value { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
a.as-trace-value { text-decoration: none; }
a.as-trace-value:hover { text-decoration: underline; }
.as-trace-serials .as-trace-value { display: flex; flex-wrap: wrap; gap: .35rem; }
.as-serial-chip { display: inline-block; padding: .15rem .5rem; border-radius: 6px; font-size: .78rem; background: var(--as-surface-2); border: 1px solid var(--as-border); color: var(--as-text); text-decoration: none; }
a.as-serial-chip { color: var(--as-teal); border-color: #cfe5e6; background: var(--as-teal-50); }
a.as-serial-chip:hover { background: var(--as-teal); color: #fff; }

.as-life { list-style: none; margin: 0; padding: 0; }
.as-life-item { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: .7rem; padding-bottom: 1rem; }
.as-life-item:last-child { padding-bottom: 0; }
.as-life-item::before { content: ""; position: absolute; top: 30px; bottom: 2px; inset-inline-start: 14px; width: 2px; background: #dfe8e8; }
.as-life-item:last-child::before { display: none; }
.as-life-dot { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: .85rem; color: var(--as-muted); background: #fff; border: 2px solid var(--as-border-strong); position: relative; }
.as-life-item.is-done .as-life-dot { color: #fff; background: var(--as-green-600); border-color: var(--as-green-600); }
.as-life-item.is-done::before { background: #9fd9bb; }
.as-life-item.is-todo .as-life-dot { color: var(--as-teal); border-color: #a9d0d2; background: var(--as-teal-50); }
.as-life-item.is-late .as-life-dot { color: #fff; background: #d0571f; border-color: #d0571f; }
.as-life-item.is-revoked .as-life-dot { color: #fff; background: #c8323a; border-color: #c8323a; }
.as-life-date { font-size: .72rem; font-weight: 700; color: var(--as-muted); letter-spacing: .02em; }
.as-life-title { font-weight: 600; font-size: .88rem; line-height: 1.3; }
.as-life-note { font-size: .78rem; color: var(--as-muted); }
.as-life-item.is-late .as-life-note, .as-life-item.is-revoked .as-life-note { color: #a8401a; }

.as-hash { display: flex; align-items: center; gap: .5rem; justify-content: space-between; padding: .4rem .5rem .4rem .7rem; border-radius: var(--as-radius-sm); background: var(--as-surface-2); border: 1px dashed var(--as-border-strong); }
.as-hash code { color: var(--as-text); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-danger-card .card-header { background: #fff7f7; }

@media (max-width: 991.98px) {
  .as-cert-hero { grid-template-columns: auto 1fr; }
  .as-cert-validity { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
  .as-cert-hero { grid-template-columns: 1fr; padding: 1rem; }
  .as-cert-seal { width: 52px; height: 52px; font-size: 1.6rem; }
  .as-trace > li { grid-template-columns: 34px 1fr; }
  .as-trace-value { grid-column: 2; }
}
@media print {
  .as-view-switch, .as-danger-card, .as-hash .btn { display: none !important; }
  .as-cert-hero, .as-spec-tile, .as-prod-card { box-shadow: none; }
}

/* ---------- Avatars with a picture (top bar, My account) ---------- */
.avatar.has-photo { background: var(--as-surface-2); overflow: hidden; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- My account ---------- */
.as-acct-hero { overflow: hidden; }
.as-acct-banner { height: 84px; background: var(--as-grad-ink); position: relative; }
.as-acct-banner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 20%, rgba(0, 168, 104, .45), transparent 55%); }
.as-acct-photo-form { display: flex; flex-direction: column; align-items: center; margin-top: -56px; position: relative; z-index: 1; }
.as-acct-avatar {
  position: relative; width: 112px; height: 112px; border-radius: 50%;
  border: 4px solid var(--as-surface); box-shadow: var(--as-shadow); background: var(--as-grad);
}
.as-acct-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--as-surface-2); }
.as-acct-avatar img[hidden], .as-acct-initials[hidden] { display: none; }
.as-acct-initials { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 2.1rem; font-weight: 750; letter-spacing: .02em; }
.as-acct-camera {
  position: absolute; inset-inline-end: -2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; margin: 0;
  background: var(--as-teal); color: #fff; border: 3px solid var(--as-surface); box-shadow: var(--as-shadow-sm);
}
.as-acct-camera:hover { background: var(--as-teal-700); }
.as-acct-photo-form:has(input[type=file]:focus-visible) .as-acct-camera { box-shadow: var(--as-ring); }
.as-acct-photo-actions { display: flex; gap: .4rem; margin-top: .6rem; }
.as-acct-photo-actions[hidden] { display: none; }
.as-acct-name { font-size: 1.2rem; font-weight: 750; text-align: center; margin: .75rem 0 0; color: var(--as-text); }
.as-acct-name-ar { text-align: center; margin: .1rem 0 0; color: var(--as-muted); font-size: 1rem; }
.as-acct-title { text-align: center; margin: .2rem 0 0; color: var(--as-muted); font-size: .88rem; }
.as-acct-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem; margin: .7rem 0 1rem; }
.as-acct-type { background: var(--as-teal-50); color: var(--as-teal-800); border: 1px solid var(--as-teal-100); font-weight: 600; }
.as-acct-facts { list-style: none; padding: 0; margin: 0 0 .9rem; border-top: 1px solid var(--as-border); }
.as-acct-facts li { display: grid; grid-template-columns: 1.4rem 1fr auto; align-items: center; gap: .4rem; padding: .5rem 0; border-bottom: 1px solid var(--as-border); font-size: .86rem; }
.as-acct-facts li .bi { color: var(--as-teal); }
.as-acct-facts li span { color: var(--as-muted); }
.as-acct-facts li strong { font-weight: 600; color: var(--as-text); text-align: end; }
.as-acct-roles { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.as-acct-roles li { display: grid; grid-template-columns: .7rem 1fr auto; align-items: center; gap: .55rem; padding: .5rem .65rem; border: 1px solid var(--as-border); border-radius: var(--as-radius-sm); background: var(--as-surface-2); font-weight: 600; font-size: .88rem; }
.as-acct-roles small { color: var(--as-muted); font-weight: 500; }
.as-acct-role-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--as-teal); }
.as-acct-role-dot.suite-platform { background: #6d4fc4; }
.as-acct-role-dot.suite-production { background: var(--as-teal); }
.as-acct-role-dot.suite-inspection { background: #c26a00; }
.as-acct-role-dot.suite-client { background: #2d6cdf; }
.as-acct-ro-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.as-acct-ro { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .75rem; border-radius: var(--as-radius-sm); background: var(--as-surface-2); border: 1px solid var(--as-border); min-width: 0; }
.as-acct-ro-label { font-size: .74rem; font-weight: 600; color: var(--as-muted); text-transform: uppercase; letter-spacing: .04em; }
.as-acct-ro-value { font-weight: 600; color: var(--as-text); overflow-wrap: anywhere; }
.as-acct-note { display: flex; gap: .5rem; align-items: flex-start; font-size: .84rem; color: var(--as-muted); margin: 0; }
.as-acct-note .bi { color: var(--as-teal); margin-top: .1rem; }
.as-acct-sec { display: grid; gap: .6rem; }
.as-acct-link {
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: .7rem;
  padding: .7rem .85rem; border: 1px solid var(--as-border); border-radius: var(--as-radius-sm);
  color: var(--as-text); text-decoration: none; background: var(--as-surface);
}
.as-acct-link:hover { border-color: var(--as-teal); background: var(--as-teal-50); color: var(--as-text); }
.as-acct-link:focus-visible { box-shadow: var(--as-ring); outline: 0; }
.as-acct-link > .bi:first-child { width: 2.4rem; height: 2.4rem; border-radius: 10px; display: grid; place-items: center; background: var(--as-teal-50); color: var(--as-teal); font-size: 1.1rem; }
.as-acct-link span { display: flex; flex-direction: column; min-width: 0; }
.as-acct-link small { color: var(--as-muted); font-size: .8rem; }
.as-acct-link-go { color: var(--as-muted); }
[dir="rtl"] .as-acct-link-go { transform: scaleX(-1); }
.as-sig-box {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  min-height: 130px; padding: 1.6rem .9rem .9rem; border-radius: var(--as-radius-sm);
  border: 1px solid var(--as-border); background: #fff;
  background-image: linear-gradient(to bottom, transparent calc(100% - 30px), var(--as-border) calc(100% - 30px), var(--as-border) calc(100% - 29px), transparent calc(100% - 29px));
}
.as-sig-box.is-empty { border-style: dashed; background-image: none; background-color: var(--as-surface-2); }
.as-sig-box.is-pending { border-color: #f2c94c; box-shadow: inset 0 0 0 1px #f2c94c; }
.as-sig-label { position: absolute; top: .45rem; inset-inline-start: .65rem; font-size: .72rem; font-weight: 600; color: var(--as-muted); text-transform: uppercase; letter-spacing: .04em; }
.as-sig-none { color: var(--as-muted); font-size: .86rem; display: flex; gap: .4rem; align-items: center; }
.as-sig-pending-row td { background: #fff8e1; }
@media (max-width: 575.98px) {
  .as-acct-ro-grid { grid-template-columns: 1fr; }
}
.as-sig-review { padding: .85rem; border: 1px solid #f2c94c; border-radius: var(--as-radius-sm); background: #fffbeb; }
.as-sig-review-head { display: flex; gap: .6rem; align-items: flex-start; }
.as-sig-review-head > .bi { color: var(--as-amber-dark); font-size: 1.15rem; }

/* ---------- Certificate type choice (after the QC checklist, Create COC form) ---------- */
.as-ct { margin: 0; min-width: 0; }
.as-ct-legend { font-size: .85rem; font-weight: 650; margin-bottom: .45rem; float: none; width: auto; }
.as-ct-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.as-ct-option {
  display: grid; grid-template-columns: 2.1rem 1fr; gap: .55rem; align-items: start; cursor: pointer; margin: 0; height: 100%;
  padding: .6rem .7rem; border: 1px solid var(--as-border-strong); border-radius: var(--as-radius-sm); background: var(--as-surface);
}
.as-ct-option > .bi { width: 2.1rem; height: 2.1rem; border-radius: 8px; display: grid; place-items: center; background: var(--as-surface-2); color: var(--as-muted); font-size: 1rem; }
.as-ct-option strong { display: block; font-size: .86rem; color: var(--as-text); line-height: 1.25; }
.as-ct-option small { display: block; color: var(--as-muted); font-size: .76rem; margin-top: .15rem; }
.as-ct-option:hover { border-color: var(--as-teal); }
.btn-check:checked + .as-ct-option { border-color: var(--as-teal); box-shadow: inset 0 0 0 1px var(--as-teal); background: var(--as-teal-50); }
.btn-check:checked + .as-ct-option > .bi { background: var(--as-teal); color: #fff; }
.btn-check:focus-visible + .as-ct-option { box-shadow: var(--as-ring); }
.as-ct-per { display: none; align-items: center; gap: .5rem; margin-top: .55rem; }
.as-ct-per input { width: 5.5rem; }
.as-ct:has(input[value="paged"]:checked) .as-ct-per { display: flex; }
.as-ct-chosen { display: inline-grid; grid-template-columns: 1.9rem 1fr; gap: .5rem; align-items: center; padding: .45rem .65rem; border-radius: var(--as-radius-sm); background: var(--as-teal-50); border: 1px solid var(--as-teal-100); }
.as-ct-chosen > .bi { color: var(--as-teal); font-size: 1.1rem; }
.as-ct-chosen strong { display: block; font-size: .85rem; }
.as-ct-chosen small { display: block; color: var(--as-muted); font-size: .76rem; }
.as-ct-item { padding: .85rem 0; border-top: 1px solid var(--as-border); }
.as-ct-item:first-of-type { border-top: 0; padding-top: 0; }
.as-ct-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-bottom: .55rem; font-size: .88rem; }
.as-ct-item-head .badge { font-weight: 600; }
.as-ct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; }
@media (max-width: 767.98px) { .as-ct-options { grid-template-columns: 1fr; } }

/* ---------- Business report charts ----------
   Colours from the validated data-viz reference palette (light surface #fff): categorical slots 1-2
   (blue, orange), the blue/red diverging pair for profit and loss, and a 5-step blue ordinal ramp for
   the pending steps. Two light slots sit below 3:1 on white, so every chart has a table view. */
.as-c-s1, .as-c-pos { --c: #257de0; fill: #257de0; }
.as-c-s2 { --c: #f47230; fill: #f47230; }
.as-c-neg { --c: #ec4647; fill: #ec4647; }
.as-c-o1 { --c: #84b9f3; fill: #84b9f3; }
.as-c-o2 { --c: #519ced; fill: #519ced; }
.as-c-o3 { --c: #2370cd; fill: #2370cd; }
.as-c-o4 { --c: #1757ac; fill: #1757ac; }
.as-c-o5 { --c: #0e3d7e; fill: #0e3d7e; }
.as-c-grid { stroke: #e7e7e7; stroke-width: 1; shape-rendering: crispEdges; }
.as-c-base { stroke: #c2c2c2; stroke-width: 1; shape-rendering: crispEdges; }
.as-c-tick { fill: var(--as-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.as-c-val { fill: var(--as-text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.as-chart { position: relative; }
.as-chart-scroll { overflow-x: auto; direction: ltr; }
.as-chart-svg { display: block; width: 100%; min-width: 440px; height: auto; }
.as-chart-hit { fill: transparent; outline: none; }
.as-chart-hit:hover, .as-chart-hit:focus-visible { fill: rgba(10, 111, 120, .07); }
.as-chart-hit:focus-visible { stroke: var(--as-teal); stroke-width: 1.5; }
.as-chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; max-width: 270px; padding: .45rem .65rem; font-size: .8rem;
  background: #fff; border: 1px solid rgba(11, 11, 11, .1); border-radius: var(--as-radius-sm); box-shadow: var(--as-shadow); }
.as-chart-tip-title { color: var(--as-muted); font-weight: 600; margin-bottom: .2rem; }
.as-chart-tip-row { display: flex; align-items: center; gap: .45rem; line-height: 1.55; }
.as-chart-tip-row strong { font-variant-numeric: tabular-nums; color: var(--as-text); }
.as-chart-tip-row span:last-child { color: var(--as-muted); }
.as-chart-tip-key { flex: none; width: 12px; height: 3px; border-radius: 2px; background: var(--c, transparent); }
.as-chart-card .card-header.as-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; flex-wrap: wrap; }
.as-chart-title { font-size: .95rem; font-weight: 700; margin: 0; }
.as-chart-sub { font-size: .78rem; color: var(--as-muted); margin: .15rem 0 0; font-weight: 400; }
.as-legend { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem .9rem; flex-wrap: wrap; font-size: .78rem; color: var(--as-muted); font-weight: 500; }
.as-legend li { display: flex; align-items: center; gap: .35rem; }
.as-legend-key { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.as-chart-empty { color: var(--as-muted); font-size: .875rem; padding: 2.75rem 0; text-align: center; margin: 0; }
.as-chart-table { margin-top: .75rem; border-top: 1px solid var(--as-border); padding-top: .55rem; }
.as-chart-table summary { font-size: .8rem; color: var(--as-teal); cursor: pointer; font-weight: 600; }
.as-chart-table table { font-size: .8rem; margin-top: .5rem; }
.mono-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-sub { position: relative; font-size: .78rem; color: var(--as-muted); margin-top: .25rem; line-height: 1.35; }
.as-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.as-hbar { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr 4rem; align-items: center; gap: .75rem; }
.as-hbars-signed .as-hbar { grid-template-columns: minmax(9rem, 16rem) 1fr 7.5rem; }
.as-hbar-name { font-size: .84rem; line-height: 1.3; }
.as-hbar-name small, .as-hbar-val small { display: block; color: var(--as-muted); font-size: .72rem; font-weight: 400; }
.as-hbar-val { font-weight: 700; text-align: end; font-size: .875rem; font-variant-numeric: tabular-nums; }
.as-hbar-track, .as-hbar-svg { display: block; }
@media (max-width: 575.98px) {
  .as-hbar, .as-hbars-signed .as-hbar { grid-template-columns: 1fr auto; }
  .as-hbar-track { grid-column: 1 / -1; grid-row: 2; }
}
