/* ════════════════════════════════════════════════════════
   Celvo — the vivid colours (decision 63)

   Loaded after calm.css, which keeps the layout, the type and the materials. This
   layer only changes the colours, after the owner's two reference dashboards:
     • the first gives the purple gradient: the side menu, the main buttons and the
       accent, with white keys on it, pill-shaped buttons and soft, lifted cards;
     • the second gives the data colours: pink, lime and cyan blocks with dark slate
       headers, on the tiles, the dials and the charts.
   Text on pink and purple is white; text on lime and cyan is dark slate, because white
   on those two would not be readable.
   ════════════════════════════════════════════════════════ */

:root {
  --v-p1: #A12BC4;              /* magenta end of the gradient */
  --v-p2: #6A1B9A;              /* the accent: 8.9:1 with white */
  --v-p3: #4527A0;              /* deep end */
  --v-grad: linear-gradient(135deg, var(--v-p1) 0%, var(--v-p2) 52%, var(--v-p3) 100%);
  --v-grad-v: linear-gradient(180deg, #8E24AA 0%, var(--v-p2) 55%, #52168A 100%);
  --v-pink: #E8437C;            /* 4.0:1 with white, for large numbers */
  --v-lime: #C0CA33;
  --v-cyan: #26C6DA;
  --v-slate: #263238;           /* the second image's headers: 13:1 on lime */
  --v-green: #2E9E4F;
  --v-red: #E53935;

  --c-accent: var(--v-p2);
  --c-accent-ink: #4A148C;
  --c-accent-tint: rgba(106, 27, 154, .10);
  --ring: 0 0 0 3px rgba(106, 27, 154, .24);
  --brand-green: var(--v-p2);
  --brand-green-mid: var(--v-p2);
  --green-700: #4A148C;
  --btn-lift: 0 1px 2px rgba(74, 20, 140, .22), 0 6px 14px -4px rgba(106, 27, 154, .45);
  --btn-lift-hover: 0 2px 4px rgba(74, 20, 140, .22), 0 12px 24px -8px rgba(106, 27, 154, .55);
  --v-card-shadow: 0 1px 2px rgba(38, 50, 56, .05), 0 10px 28px -12px rgba(38, 50, 56, .22);
  --c-bg: #F4F3F8;
  --app-bg: #F4F3F8;
}
body { background: var(--c-bg); }
::selection { background: rgba(161, 43, 196, .22); }

/* ─── The side menu: the purple gradient, with white keys ─── */
.sidebar, [dir="ltr"] .sidebar {
  background: linear-gradient(170deg, #9C27B0 0%, #6A1B9A 38%, #4527A0 100%);
  border-inline-end: 0; color: #fff;
  box-shadow: 0 0 24px rgba(69, 39, 160, .25);
}
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .4); }
.sb-logo { background: #fff; border-radius: 50%; padding: 5px; width: 42px; height: 42px;
  box-shadow: 0 4px 12px rgba(38, 0, 70, .3); }
.sb-word { color: #fff; }
.sidebar-brand .brand-subtitle { color: rgba(255, 255, 255, .72); }
.sidebar-section-title, .sidebar-section-title.sg-h { color: rgba(255, 255, 255, .66); }
.sidebar-section-title.sg-h:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sg-n { color: #fff; background: rgba(255, 255, 255, .14); }
.sg-cv { color: rgba(255, 255, 255, .6); }
.sidebar-link { color: rgba(255, 255, 255, .86); }
.sidebar-link i { color: rgba(255, 255, 255, .62); }
.sidebar-link:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.sidebar-link:hover i { color: #fff; }
.sidebar-link.active {
  background: #fff; color: var(--v-p2); font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(30, 0, 60, .45);
}
.sidebar-link.active i { color: var(--v-p2); }
.sidebar-link:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.sb-count { background: var(--v-pink); color: #fff; box-shadow: none; }
.sidebar-link.active .sb-count { background: var(--v-p2); }
.sb-foot { border-top-color: rgba(255, 255, 255, .14) !important; }
.sidebar-footer { color: rgba(255, 255, 255, .6); }

/* ─── Buttons: purple pills; green and red where the action says so ─── */
.btn { border-radius: 999px; }
.btn-group > .btn, .btn-group-sm > .btn, .input-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child, .input-group > .btn:first-child { border-start-start-radius: 999px; border-end-start-radius: 999px; }
.btn-group > .btn:last-child, .input-group > .btn:last-child { border-start-end-radius: 999px; border-end-end-radius: 999px; }
.btn-primary, .tb-new-btn, .rpx-run,
.section-header .btn-info, .section-header .btn-warning {
  background: var(--v-grad); border: 1px solid #52168A; color: #fff;
}
.btn-primary:hover, .tb-new-btn:hover, .tb-new[open] .tb-new-btn, .rpx-run:hover,
.section-header .btn-info:hover, .section-header .btn-warning:hover {
  background: linear-gradient(135deg, #8E24AA 0%, #5A1488 55%, #3A2090 100%); border-color: #3F1078; color: #fff;
}
.btn-primary:active, .tb-new-btn:active, .rpx-run:active, .btn-primary.active {
  background: #4A148C; border-color: #3F1078;
}
.btn-success {
  background: linear-gradient(180deg, #43A85F 0%, var(--v-green) 100%); border: 1px solid #237A3C; color: #fff;
  box-shadow: var(--btn-hi), var(--btn-lo), 0 1px 2px rgba(20, 90, 40, .22), 0 6px 14px -4px rgba(46, 158, 79, .45);
}
.btn-success:hover { background: linear-gradient(180deg, #2E9E4F 0%, #237A3C 100%); border-color: #1C6532; color: #fff; }
.btn-success:active, .btn-success.active { background: #1C6532; border-color: #1C6532; }
.btn-danger {
  background: linear-gradient(180deg, #EF5350 0%, var(--v-red) 100%); border: 1px solid #B71C1C; color: #fff;
}
.btn-dark, .btn-secondary {
  background: linear-gradient(180deg, #37474F 0%, var(--v-slate) 100%); border: 1px solid #1B2429; color: #fff;
}
.btn-dark:hover, .btn-secondary:hover { background: #1B2429; border-color: #11181B; }
.btn-outline-primary, .btn-outline-success { border-color: rgba(106, 27, 154, .5); color: var(--v-p2); }
.btn-outline-primary:hover, .btn-outline-success:hover,
.btn-check:checked + .btn-outline-primary, .btn-outline-primary.active {
  background: var(--v-grad); border-color: #52168A; color: #fff;
}
.tb-avatar {
  background: var(--v-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 2px #fff, 0 0 0 3px rgba(161, 43, 196, .45),
              0 4px 10px -2px rgba(69, 39, 160, .4);
}
.list-chip[aria-pressed="true"] { background: var(--v-grad); border-color: #52168A; color: #fff; }
.form-control:focus, .form-select:focus { border-color: #9C4DCC; box-shadow: var(--ring); }
.form-check-input:checked { background-color: var(--v-p2); border-color: var(--v-p2); }
a { color: var(--v-p2); }
.page-item.active .page-link { background: var(--v-p2); border-color: var(--v-p2); }
.nav-scrim { background: rgba(38, 50, 56, .32); }

/* ─── Cards lift off the page ─── */
.home-card, .mt-card, .lb-card, .lb-empty, .data-table-wrapper, .card {
  border-color: rgba(38, 50, 56, .06); box-shadow: var(--v-card-shadow);
}
.home-card, .mt-card { border-radius: 16px; }

/* ─── Home: the four tiles ─── */
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.kp {
  display: flex; flex-direction: column; text-align: start; padding: 0; border: 0; border-radius: 16px; overflow: hidden;
  font: inherit; cursor: pointer; box-shadow: var(--v-card-shadow);
  transition: transform .18s var(--ease-out, ease-out), box-shadow .18s var(--ease-out, ease-out);
}
.kp:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(38, 50, 56, .06), 0 16px 32px -14px rgba(38, 50, 56, .35); }
.kp:focus-visible { outline: 3px solid var(--v-p1); outline-offset: 2px; }
.kp-label { background: var(--v-slate); color: #fff; font-size: 14px; font-weight: 600; padding: 10px 16px; }
.kp-body { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 16px; min-height: 96px; justify-content: center; }
.kp-val { font-size: 36px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kp-unit { font-size: 13px; opacity: .92; }
.kp-paid { font-weight: 600; margin-top: 4px; }
.kp-spend   .kp-body { background: var(--v-grad); color: #fff; }
.kp-late    .kp-body { background: var(--v-pink); color: #fff; }
.kp-overdue .kp-body { background: var(--v-lime); color: var(--v-slate); }
.kp-lead    .kp-body { background: var(--v-cyan); color: var(--v-slate); }

/* ─── Home: the dials take the data colours ─── */
.mt-prs-ordered, .mt-pos-done, .mt-del-onTrack { --tone: #6A1B9A; }
.mt-pos-active                                 { --tone: #AB47BC; }
.mt-prs-accepted, .mt-pos-approved             { --tone: #26C6DA; }
.mt-prs-waiting, .mt-pos-waiting, .mt-del-dueSoon { --tone: #C0CA33; }
.mt-pos-draft                                  { --tone: #CFD8DC; }
.mt-del-overdue                                { --tone: #E8437C; }
.mt-head button { color: var(--c-ink); }
.mt-head button:hover { color: var(--v-p2); }

/* ─── Home: the six-month trend ─── */
.home-trend { gap: 10px; }
.tr-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.tr-legend { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--c-ink-2); }
.tr-legend li { display: inline-flex; align-items: center; gap: 6px; }
.tr-key { width: 12px; height: 12px; border-radius: 4px; }
.tr-key.tr-prs { background: var(--v-pink); border-radius: 50%; }
.tr-key.tr-pos { background: var(--v-grad-v); }
.tr-svg { width: 100%; height: auto; display: block; overflow: visible; }
.tr-grid { stroke: #E6E3EE; stroke-width: 1; }
.tr-y, .tr-x { fill: var(--c-muted); font-size: 12px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.tr-y { text-anchor: end; }
[dir="rtl"] .tr-y { text-anchor: end; }
.tr-x { text-anchor: middle; }
.tr-bar { fill: url(#tr-bar-g); }
.tr-g1 { stop-color: #AB47BC; } .tr-g2 { stop-color: #4527A0; }
.tr-a1 { stop-color: #E8437C; stop-opacity: .22; } .tr-a2 { stop-color: #E8437C; stop-opacity: 0; }
.tr-area { fill: url(#tr-area-g); }
.tr-line { fill: none; stroke: var(--v-pink); stroke-width: 3; stroke-linecap: round; }
.tr-dot { fill: #fff; stroke: var(--v-pink); stroke-width: 2.5; }

/* ─── Home: the rest takes the accent ─── */
.hm-bar span { background: var(--v-grad); }
.hf-who { background: rgba(106, 27, 154, .10); color: var(--v-p2); }
.ha-kind.ha-late, .ha-kind.ha-due { color: #9C1452; background: #FCE4EC; }
.ha-when.ha-late { color: #B0174F; }

/* ─── The late board ─── */
.lb-dot { background: var(--v-p1); box-shadow: 0 0 0 0 rgba(161, 43, 196, .45); }
@keyframes lb-pulse { 0% { box-shadow: 0 0 0 0 rgba(161, 43, 196, .45); } 70%, 100% { box-shadow: 0 0 0 8px rgba(161, 43, 196, 0); } }
.lb { --lb-late: #8A5A00; --lb-late-bar: #C0CA33; --lb-crit: #B0174F; --lb-crit-bar: #E8437C; }
body.lb-screen .lb { --lb-ground: #1E272C; --lb-late: #D4DE5A; --lb-late-bar: #C0CA33; --lb-crit: #FF7AA6; --lb-crit-bar: #E8437C; }
body.lb-screen .lb-dot, body.lb-screen .lb-empty i { background: none; }
body.lb-screen .lb-dot { background: #CE93D8; }
body.lb-screen .lb-empty i { color: #CE93D8; }

@media (prefers-reduced-motion: reduce) {
  .kp { transition: none; }
  .kp:hover { transform: none; }
}
@media (max-width: 600px) {
  .tr-y, .tr-x { font-size: 22px; }
  .kp-val { font-size: 30px; }
}

/* ── Approval settings: pictures of what each choice produces (decision 69) ── */
.apd-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; }
.apd-chain-sm .apd-node { min-width: 0; font-size: .82rem; }
.apd-node { background: #fff; border: 1.5px solid var(--v-p2); border-radius: 12px; padding: 7px 11px; min-width: 120px; max-width: 230px;
  box-shadow: var(--v-card-shadow); }
.apd-node-t { font-weight: 700; color: var(--v-slate); line-height: 1.3; }
.apd-node-s { font-size: .78rem; color: var(--c-muted); line-height: 1.35; margin-top: 2px; }
.apd-node.apd-start { background: var(--v-grad); border-color: transparent; }
.apd-node.apd-start .apd-node-t, .apd-node.apd-start .apd-node-s { color: #fff; }
.apd-node.apd-end { background: #E8F5EC; border-color: var(--v-green); }
.apd-node.apd-end .apd-node-t { color: #1B5E35; }
.apd-node.apd-maybe { border-style: dashed; background: #FBF8FD; }
.apd-node.apd-cycle { border-color: var(--v-p1); background: var(--c-accent-tint); min-width: 0; }
.apd-arrow { color: var(--v-p2); font-size: 1.1rem; padding: 0 2px; }
.apd-badge { display: inline-block; margin-top: 4px; margin-inline-end: 4px; font-size: .72rem; border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.apd-badge-gate { background: #E8F5EC; color: #1B5E35; }
.apd-badge-dedupe { background: #FFF1DC; color: #8A4600; }
.apd-badge-print { background: #EEF2F5; color: #34485F; }
.apd-legend { font-size: .78rem; color: var(--c-muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.apd-swatch { display: inline-block; width: 22px; height: 12px; border: 1.5px dashed var(--v-p2); border-radius: 4px; }
.apd-empty { color: var(--c-muted); font-style: italic; padding: 6px 10px; border: 1.5px dashed var(--c-line); border-radius: 10px; }
.apd-sub { font-weight: 700; color: var(--c-accent-ink); margin-bottom: 6px; }
.apd-flow { display: flex; flex-direction: column; align-items: flex-start; }
.apd-flow-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.apd-down { color: var(--v-p2); padding: 2px 18px; display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; }
.apd-down span { color: var(--c-muted); }
.apd-q { background: #FFF; border: 1.5px solid var(--v-cyan); border-radius: 12px; padding: 6px 12px; font-size: .86rem; max-width: 460px; }
.apd-q-else { border-color: var(--c-line); background: var(--c-bg); font-weight: 600; }
.apd-and { display: inline-block; margin: 0 6px; font-weight: 700; color: var(--v-p2); }
.apd-yes { font-size: .8rem; font-weight: 700; color: var(--v-green); }
.apd-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--v-grad); color: #fff; font-size: .75rem; font-weight: 700; margin-inline-end: 6px; flex: none; }
.apd-overview { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px 4px; }
.apd-overview .apd-arrow { align-self: center; }
.apd-ov { display: flex; flex-direction: column; align-items: flex-start; text-align: start; background: #fff; border: 1.5px solid var(--c-line);
  border-radius: 14px; padding: 8px 12px; min-width: 150px; max-width: 220px; flex: 1 1 150px; transition: border-color var(--t), box-shadow var(--t); }
.apd-ov:hover { border-color: var(--v-p2); box-shadow: var(--v-card-shadow); }
.apd-ov.apd-ov-on { border-color: var(--v-p2); background: var(--c-accent-tint); }
.apd-ov-t { font-weight: 700; color: var(--v-slate); display: flex; align-items: center; }
.apd-ov .apd-num { position: static; }
.apd-ov-s { font-size: .78rem; color: var(--c-muted); margin-top: 2px; }
.apd-type { border: 1px solid var(--c-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.apd-type.apd-off { opacity: .6; }
.apd-type-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.apd-chip { background: var(--v-grad); color: #fff; border-radius: 999px; padding: 3px 12px; font-weight: 700; }
.apd-off-l { font-size: .75rem; color: var(--c-muted); }
.apd-cyname { font-weight: 700; color: var(--c-accent-ink); }
.apd-also { font-size: .8rem; color: var(--c-muted); margin-top: 6px; }
.apd-locks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.apd-lock { display: block; border: 1.5px solid var(--c-line); border-radius: 14px; padding: 12px; cursor: pointer; background: #fff; position: relative; }
.apd-lock input { position: absolute; inset-inline-end: 12px; top: 14px; }
.apd-lock.apd-on { border-color: var(--v-p2); background: var(--c-accent-tint); }
.apd-lock-t { font-weight: 700; margin-bottom: 10px; padding-inline-end: 24px; }
.apd-rec { font-size: .72rem; background: #E8F5EC; color: #1B5E35; border-radius: 999px; padding: 1px 8px; }
.aps-tabs .nav-link { border-radius: 999px; display: flex; align-items: center; font-weight: 600; }
.aps-tabs .nav-link.active { background: var(--v-grad); }
.aps-tabs .nav-link.active .apd-num { background: #fff; color: var(--v-p2); }
.aps-tabs .nav-link:not(.active) { color: var(--c-accent-ink); }
.aps-tabs .nav-link:not(.active):hover { background: var(--c-accent-tint); }
.aps-steps { background: #fff; border: 1.5px solid var(--v-cyan); border-radius: 14px; padding: 12px 16px; }
.aps-steps-h { font-weight: 700; color: var(--c-accent-ink); margin-bottom: 6px; }
.aps-steps ol { padding-inline-start: 1.3rem; }
.aps-steps li { margin-bottom: 3px; }
.apd-badge-nomail { background: #FDECEA; color: #B42318; }

/* ─── Purchase-order approval setup (decision 70, js/approval-setup.js) ─── */
.ast-types { display: flex; flex-direction: column; gap: 6px; }
.ast-type { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: start; width: 100%;
  border: 1.5px solid var(--c-line); background: #fff; border-radius: 12px; padding: 8px 12px; }
.ast-type span { font-size: .78rem; color: var(--c-muted); }
.ast-type:hover { border-color: var(--v-p2); }
.ast-type.on { border-color: var(--v-p2); background: var(--c-accent-tint); }
.ast-type.off { opacity: .6; }
.ast-add { border-top: 1px solid var(--c-line); padding-top: 10px; }
.ast-pos { border: 1px solid var(--c-line); border-radius: 10px; padding: 6px; margin-bottom: 6px; }
.ast-steps { display: flex; flex-direction: column; gap: 8px; }
.ast-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto auto; gap: 8px 12px; align-items: start;
  border: 1.5px solid var(--c-line); border-radius: 14px; padding: 10px; background: #fff; }
.ast-step-ap { border-color: var(--v-lime); box-shadow: 0 0 0 2px rgba(192, 202, 51, .22); }
.ast-step-after { background: var(--c-bg); }
.ast-condcell { grid-column: 2 / -1; grid-row: 2; }
.ast-step .ast-acts { grid-column: 5; grid-row: 1; }
@media (max-width: 600px) { .ast-step { grid-template-columns: 34px auto auto minmax(0, 1fr); }
  .ast-step > .ast-cell:not(.ast-condcell) { grid-column: 2 / -1; grid-row: 1; }
  .ast-step .ast-tog { grid-row: 2; } .ast-step .ast-acts { grid-column: 4; grid-row: 2; justify-self: end; align-self: center; }
  .ast-condcell { grid-row: 3; } }
.ast-num { width: 30px; height: 30px; border-radius: 50%; background: var(--v-grad); color: #fff; display: grid; place-items: center; font-weight: 700; }
.ast-step-after .ast-num { background: var(--c-muted); }
.ast-cell { min-width: 0; }
.ast-tog { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .74rem; color: var(--c-muted); font-weight: 600; min-width: 64px; margin: 0; }
.ast-tog input { width: 20px; height: 20px; accent-color: var(--v-p2); cursor: pointer; }
.ast-tog input:disabled { cursor: not-allowed; opacity: .35; }
.ast-tog-ap input { accent-color: #8D9A12; }
.ast-acts { display: flex; gap: 4px; }
.ast-cond { border: 1.5px dashed var(--c-line); border-radius: 10px; padding: 6px 8px; }
.ast-dchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ast-dchip { border: 1px solid var(--c-line); border-radius: 999px; padding: 1px 10px; font-size: .78rem; background: #fff; }
.ast-dchip[aria-pressed="true"] { background: rgba(38, 198, 218, .16); border-color: var(--v-cyan); color: #0B5560; font-weight: 600; }
.ast-newpos { border: 1px solid var(--v-p2); border-radius: 10px; padding: 6px; background: var(--c-accent-tint); }
.ast-flow { display: flex; flex-wrap: wrap; align-items: stretch; row-gap: 10px; padding: 8px 2px 10px; }
.ast-node { flex: none; min-width: 150px; max-width: 200px; border: 1.5px solid var(--c-line); border-radius: 14px; padding: 8px 11px; background: #fff;
  display: flex; flex-direction: column; gap: 2px; }
.ast-node-n { font-size: .74rem; color: var(--c-muted); }
.ast-node-t { font-weight: 700; color: var(--v-slate); line-height: 1.3; }
.ast-node-p { font-size: .8rem; color: var(--c-muted); }
.ast-node.ast-ap { border-color: var(--v-lime); background: #F8FAE3; }
.ast-node.ast-after { border-style: dashed; }
.ast-node.ast-out { opacity: .55; border-style: dotted; }
.ast-node.ast-out .ast-node-t { text-decoration: line-through; }
.ast-chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.ast-chip { font-size: .7rem; border-radius: 999px; padding: 0 8px; font-weight: 600; background: #EEF2F5; color: #34485F; }
.ast-chip-ap { background: #EEF3C0; color: #3B4210; }
.ast-chip-if { background: rgba(38, 198, 218, .16); color: #0B5560; }
.ast-chip-out { background: #FFF1DC; color: #8A4600; }
.ast-link { flex: none; align-self: center; color: var(--v-p2); padding: 0 6px; }
.ast-start, .ast-end { flex: none; align-self: center; border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 700; }
.ast-start { background: var(--v-grad); color: #fff; }
.ast-end { background: #E8F5EC; color: #1B5E35; }
.ast-end-bad { background: #FDE7EE; color: #B0204F; }
.ast-sigs { display: flex; flex-wrap: wrap; gap: 8px; }
.ast-sig { border: 1px solid var(--c-line); border-radius: 8px; padding: 6px 10px; min-width: 130px; font-size: .8rem; background: #fff; }
.ast-sig-ln { border-bottom: 1px solid var(--c-muted); height: 20px; margin-bottom: 4px; }
/* A settings sub-screen's save bar (decision 71): always in view at the bottom. */
.ast-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; padding: 10px 14px; background: #fff; border: 1px solid var(--c-line); border-radius: 12px; box-shadow: 0 -4px 16px rgba(40, 20, 80, .08); }
.ast-savebar.on { border-color: #F2B705; background: #FFF8E1; }
.apl-person { border: 1px solid var(--c-line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }
.apl-dept.off { opacity: .65; }
.apl-drow { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; text-align: start;
  border: 1px solid var(--c-line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }
.apl-drow:hover, .apl-drow:focus-visible { border-color: #7b3fe4; box-shadow: 0 0 0 2px rgba(123,63,228,.15); }
.apl-drow.off { opacity: .65; }
.apl-drow-main { display: flex; flex-direction: column; min-width: 0; }
.apl-sub { border-inline-start: 3px solid var(--c-line); padding-inline-start: 8px; }
.apl-member { border: 1px dashed var(--c-line); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; }
.ast-rrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--c-line); }
.ast-rrow:last-child { border-bottom: 0; }

/* One search box for every document (release 5). */
.gsearch{position:relative;display:flex;align-items:center;gap:6px;background:var(--bs-body-bg,#fff);border:1px solid rgba(0,0,0,.12);border-radius:999px;padding:2px 10px;min-width:220px}
.gsearch input{border:0;outline:0;background:transparent;font-size:14px;width:100%;min-width:0}
.gs-results{position:absolute;top:calc(100% + 6px);inset-inline-start:0;width:min(440px,92vw);max-height:70vh;overflow:auto;background:var(--bs-body-bg,#fff);border:1px solid rgba(0,0,0,.12);border-radius:12px;box-shadow:0 10px 30px rgba(16,24,40,.18);z-index:1080;padding:4px}
.gs-item{display:grid;grid-template-columns:22px 1fr auto;grid-template-areas:"i t k" "i s s";gap:0 8px;width:100%;text-align:start;border:0;background:transparent;padding:6px 8px;border-radius:8px}
.gs-item:hover,.gs-item:focus{background:rgba(124,58,237,.08)}
.gs-item i{grid-area:i;align-self:center}.gs-t{grid-area:t;font-weight:700}.gs-k{grid-area:k;font-size:12px;opacity:.7}.gs-s{grid-area:s;font-size:12px;opacity:.75;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gs-none{padding:10px;font-size:13px;opacity:.75}
@media (max-width:767.98px){.gsearch{min-width:0;flex:1 1 120px}}
/* A phone (release 5): the search box shares the bar instead of pushing the account
   button off the screen; the screen's name gives way to it. */
@media (max-width:600px){.top-bar-title{display:none}.tb-tools{flex:1 1 auto;min-width:0;gap:8px}.tb-tools>*{flex-shrink:0}.tb-tools>.gsearch{flex:1 1 0;min-width:60px;padding:2px 8px}.gs-results{inset-inline:0;min-width:0}}

/* Round 2, batch 1: a role without the money view sees no prices or totals. Amounts
   printed through Arabic.formatEGP read as a dash; whole columns and cards marked
   .money are removed. */
.no-money .money { display: none !important; }
/* A phone (round 2, batch 2): a lines table becomes one card per line, each field with
   its label, instead of a table wider than the screen that hides Unit and Quantity. */
@media (max-width:575.98px){
  table.lines-stack thead{display:none}
  table.lines-stack,table.lines-stack tbody,table.lines-stack tr,table.lines-stack td{display:block;width:100%}
  table.lines-stack tr{position:relative;border:1px solid var(--bs-border-color,#dee2e6);border-radius:12px;margin:10px 8px;padding:6px 8px 4px;width:auto}
  table.lines-stack td{border:0!important;padding:4px 2px}
  table.lines-stack td:first-child{font-size:.85rem;padding-bottom:0}
  table.lines-stack td[data-label]::before{content:attr(data-label);display:block;font-size:.8rem;color:var(--bs-secondary-color,#6c757d);margin-bottom:2px}
  table.lines-stack td.lines-stack-del{position:absolute;top:4px;inset-inline-end:6px;width:auto}
  table.lines-stack td .form-control{font-size:16px}
  table.lines-stack td.ls-half{display:inline-block;width:49%;vertical-align:top}
}
