/* ==========================================================================
   Application design system
   --------------------------------------------------------------------------
   Loaded after the template's stylesheets. Everything visual is decided here:
   tokens first, then the page shell, then components, then single screens.
   Spacing and alignment use logical properties (inline-start / inline-end),
   so the same rules are correct in the right-to-left layout.
   ========================================================================== */

/* 1. Tokens --------------------------------------------------------------- */
:root {
    /* brand */
    --brand-50: #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-300: #a5b4fc;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;

    /* neutrals */
    --ink-950: #0b1120;
    --ink-900: #0f172a;
    --ink-800: #1e293b;
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --ink-300: #cbd5e1;
    --ink-200: #e2e8f0;
    --ink-100: #f1f5f9;
    --ink-50: #f8fafc;

    --canvas: #f5f6fa;
    --surface: #ffffff;
    --surface-raised: #ffffff;

    /* status */
    --success: #047857;
    --success-soft: #ecfdf5;
    --success-line: #a7f3d0;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --warning-line: #fde68a;
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --danger-line: #fecaca;
    --info: #0369a1;
    --info-soft: #f0f9ff;
    --info-line: #bae6fd;

    /* shape, depth, motion */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 12px 28px -10px rgba(15, 23, 42, 0.18), 0 4px 10px -6px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 28px 60px -20px rgba(15, 23, 42, 0.3);
    --ring: 0 0 0 3px rgba(99, 102, 241, 0.22);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
    --sidebar-width: 16.25rem;
    --topbar-height: 4rem;

    /* keep the template's own variables in step with the tokens */
    --bs-primary: var(--brand-600);
    --bs-primary-rgb: 79, 70, 229;
    --bs-body-color: var(--ink-700);
    --bs-body-bg: var(--canvas);
    --bs-font-sans-serif: var(--font);
    --bs-body-font-family: var(--font);
}

/* 2. Base ------------------------------------------------------------------ */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    /* the page keeps its width when a dialog hides the scrollbar */
    scrollbar-gutter: stable;
}

body.modal-open {
    padding-inline: 0 !important;
}

body {
    font-family: var(--font);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink-700);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font);
    color: var(--ink-900);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.35;
}

a {
    color: var(--brand-600);
    text-decoration: none;
}

a:hover {
    color: var(--brand-700);
}

small, .small {
    font-size: 0.8125rem;
}

.text-muted {
    color: var(--ink-500) !important;
}

.text-primary {
    color: var(--brand-600) !important;
}

.text-body {
    color: var(--ink-700) !important;
}

::selection {
    background: var(--brand-100);
    color: var(--brand-800);
}

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

/* numbers stay aligned where they sit in columns */
table, .tabular {
    font-variant-numeric: tabular-nums;
}

/* thin, quiet scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--ink-300) transparent;
}

/* 3. Page shell ------------------------------------------------------------ */
.layout-wrapper,
.layout-container {
    background: var(--canvas);
}

/* 3.1 Sidebar */
.layout-menu.bg-menu-theme {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 100%) !important;
    color: var(--ink-300);
    border: 0;
    box-shadow: none;
}

.layout-menu .app-brand {
    height: var(--topbar-height);
    padding-inline: 1.25rem;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.layout-menu .app-brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.app-brand-logo.demo,
.app-brand-mark {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.8);
}

.app-brand-logo.demo img,
.app-brand-mark img {
    width: 1.25rem;
    height: 1.25rem;
    filter: brightness(0) invert(1);
}

.layout-menu .app-brand-text.demo {
    margin: 0 !important;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: #fff;
}

.app-brand-role {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--ink-400);
    line-height: 1.2;
}

.layout-menu .layout-menu-toggle {
    margin-inline-start: auto;
    color: var(--ink-300) !important;
}

.layout-menu .menu-inner-shadow {
    display: none !important;
}

.layout-menu .menu-inner {
    padding: 0.75rem 0.75rem 1.5rem !important;
    overflow-x: hidden !important;
}

.layout-menu .menu-header {
    margin: 1rem 0 0.375rem;
    padding: 0 0.75rem;
    color: var(--ink-500);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.layout-menu .menu-header::before {
    display: none !important;
}

.layout-menu .menu-item {
    margin: 0.125rem 0;
}

.layout-menu .menu-inner > .menu-item > .menu-link,
.layout-menu .menu-sub > .menu-item > .menu-link {
    margin: 0;
    border-radius: 8px;
    color: var(--ink-300);
    font-weight: 500;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.layout-menu .menu-inner > .menu-item > .menu-link {
    padding: 0.5625rem 0.75rem;
    gap: 0.625rem;
}

.layout-menu .menu-link .menu-icon,
.layout-menu .menu-link > i {
    margin: 0 !important;
    width: 1.375rem;
    font-size: 1.25rem;
    color: var(--ink-400);
    flex: 0 0 auto;
    text-align: center;
}

.layout-menu .menu-link:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
}

.layout-menu .menu-link:hover > i {
    color: #fff;
}

/* the open group and the current page */
.layout-menu .menu-inner > .menu-item.open > .menu-link,
.layout-menu .menu-inner > .menu-item.active > .menu-link {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #fff !important;
}

.layout-menu .menu-inner > .menu-item.active:not(.open) > .menu-link {
    background: var(--brand-600) !important;
    box-shadow: 0 8px 18px -10px rgba(79, 70, 229, 0.9);
}

.layout-menu .menu-inner > .menu-item.active > .menu-link > i {
    color: #fff;
}

.layout-menu .menu-inner > .menu-item.active::before {
    display: none !important;
}

.layout-menu .menu-sub {
    padding: 0.25rem 0 0.25rem !important;
    background: transparent !important;
}

.layout-menu .menu-sub > .menu-item > .menu-link {
    padding: 0.4375rem 0.75rem;
    padding-inline-start: 2.75rem;
    font-size: 0.875rem;
    color: var(--ink-400);
}

.layout-menu .menu-sub > .menu-item > .menu-link::before {
    inset-inline-start: 1.25rem !important;
    inset-inline-end: auto !important;
    width: 6px !important;
    height: 6px !important;
    border-radius: 50%;
    background: var(--ink-600) !important;
    box-shadow: none !important;
}

.layout-menu .menu-sub > .menu-item.active > .menu-link {
    color: #fff !important;
    background: transparent !important;
    font-weight: 600;
}

.layout-menu .menu-sub > .menu-item.active > .menu-link::before {
    background: var(--brand-400) !important;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2) !important;
}

.menu-badge {
    margin-inline-start: auto;
    padding: 0.0625rem 0.4375rem;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.18);
    color: var(--brand-200);
    font-size: 0.6875rem;
    font-weight: 700;
}


/* 3.2 Top bar */
.layout-page {
    background: var(--canvas);
}

.layout-navbar.navbar,
.layout-navbar.navbar.navbar-detached {
    position: sticky;
    top: 0;
    /* The template's core.css sets z-index 2 here with a longer selector, which
       put the top bar and its dropdowns under the pages' sticky tab bars. */
    z-index: 1040 !important;
    width: 100% !important;
    max-width: none;
    height: var(--topbar-height);
    margin: 0 !important;
    padding: 0 1.5rem !important;
    border: 0;
    border-bottom: 1px solid var(--ink-200);
    border-radius: 0 !important;
    background: color-mix(in srgb, var(--surface) 90%, transparent) !important;
    backdrop-filter: saturate(160%) blur(10px);
    box-shadow: none !important;
}

.app-topbar__title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layout-navbar .navbar-nav-right {
    flex: 1 1 auto;
    gap: 0.5rem;
}

.layout-navbar .navbar-nav {
    gap: 0.375rem;
}

.topbar-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    color: var(--ink-600);
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.topbar-icon:hover,
.show > .topbar-icon {
    background: var(--ink-100);
    color: var(--ink-900);
}

.topbar-icon .noti-counter,
.noti-counter {
    position: absolute !important;
    top: 0.25rem;
    inset-inline-end: 0.125rem;
    inset-inline-start: auto;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    border: 2px solid var(--surface);
    border-radius: 999px;
    background: var(--danger) !important;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 0.875rem;
    text-align: center;
}

.noti-counter:empty,
.noti-counter--empty {
    display: none !important;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.25rem 0.375rem;
    padding-inline-end: 0.75rem;
    border-radius: 999px;
    color: var(--ink-800);
    transition: background-color 0.15s var(--ease);
}

.topbar-user:hover,
.show > .topbar-user {
    background: var(--ink-100);
    color: var(--ink-900);
}

.topbar-user__name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.topbar-user__role {
    display: block;
    font-size: 0.75rem;
    color: var(--ink-500);
    line-height: 1.2;
}

/* initials instead of a stock photo */
.avatar-initials {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.avatar-initials--lg {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.0625rem;
}

/* 3.3 Content and footer */
.content-wrapper {
    background: var(--canvas);
}

.container-p-y:not([class^="pt-"]):not([class*=" pt-"]) {
    padding-top: 1.75rem !important;
}

.container-p-y:not([class^="pb-"]):not([class*=" pb-"]) {
    padding-bottom: 2rem !important;
}

.content-wrapper > .container-xxl,
.content-wrapper > .container-fluid {
    padding-inline: 1.75rem;
    max-width: 1560px;
}

/* the page heading every list and form page starts with */
.content-wrapper h4.fw-bold.py-3.mb-4,
.page-heading {
    margin: 0 0 1.25rem !important;
    padding: 0 !important;
    font-size: 1.375rem;
    font-weight: 700 !important;
    color: var(--ink-900);
}

.content-wrapper h4.fw-bold.py-3.mb-4 .text-muted {
    font-weight: 500 !important;
    color: var(--ink-400) !important;
}

.content-footer {
    padding: 1rem 0 1.25rem;
    border-top: 1px solid var(--ink-200);
    background: transparent !important;
    color: var(--ink-500);
    font-size: 0.8125rem;
}

.content-footer a,
.footer-link {
    color: var(--ink-600);
    font-weight: 500;
}

/* 4. Components ------------------------------------------------------------ */

/* 4.1 Cards */
.card {
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.card-header {
    padding: 1.125rem 1.375rem;
    border-bottom: 1px solid var(--ink-100);
    background: transparent;
}

h5.card-header,
.card-header > h5,
.card-header .card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-900);
}

.card-header + hr,
.card > hr.my-0 {
    display: none;
}

.card-body {
    padding: 1.375rem;
}

/* the header has its own rule under it, so the body keeps its top spacing */
.card-header + .card-body {
    padding-top: 1.375rem;
}

.card-header + .card-body.p-0 {
    padding-top: 0;
}

.card-footer {
    padding: 1rem 1.375rem;
    border-top: 1px solid var(--ink-100);
    background: var(--ink-50);
}

/* a list page's card header: title on one side, primary action on the other */
.card-header > .row {
    align-items: center;
    margin: 0 !important;
}

.card-header > .row > [class*="col"] {
    padding: 0;
}

.card-header h5 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
}

.card > .table-responsive.p-3,
.card > .text-nowrap.table-responsive {
    padding: 0 !important;
}

/* 4.2 Buttons */
.btn {
    --btn-h: 2.5rem;
    min-height: var(--btn-h);
    padding: 0.4375rem 1rem;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.5;
    box-shadow: none !important;
    transform: none !important;
    transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.btn:focus-visible {
    box-shadow: var(--ring) !important;
    outline: 0;
}

.btn-sm {
    --btn-h: 2rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    --btn-h: 2.875rem;
    padding: 0.625rem 1.375rem;
    font-size: 0.9375rem;
}

.btn-primary {
    border-color: var(--brand-600);
    background: var(--brand-600);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    border-color: var(--brand-700) !important;
    background: var(--brand-700) !important;
    color: #fff !important;
}

.btn-primary:disabled,
.btn-primary.disabled {
    border-color: var(--brand-200) !important;
    background: var(--brand-200) !important;
    color: #fff !important;
    opacity: 1;
}

.btn-secondary,
.btn-outline-secondary,
.btn-label-secondary {
    border-color: var(--ink-300);
    background: var(--surface);
    color: var(--ink-700);
}

.btn-secondary:hover,
.btn-outline-secondary:hover,
.btn-label-secondary:hover,
.btn-secondary:focus,
.btn-outline-secondary:focus {
    border-color: var(--ink-400) !important;
    background: var(--ink-50) !important;
    color: var(--ink-900) !important;
}

.btn-outline-primary {
    border-color: var(--brand-200);
    background: var(--surface);
    color: var(--brand-700);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    border-color: var(--brand-600) !important;
    background: var(--brand-50) !important;
    color: var(--brand-700) !important;
}

.btn-success {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.btn-success:hover,
.btn-success:focus {
    border-color: #065f46 !important;
    background: #065f46 !important;
    color: #fff !important;
}

.btn-danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus {
    border-color: #991b1b !important;
    background: #991b1b !important;
    color: #fff !important;
}

.btn-outline-danger {
    border-color: var(--danger-line);
    background: var(--surface);
    color: var(--danger);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    border-color: var(--danger) !important;
    background: var(--danger-soft) !important;
    color: var(--danger) !important;
}

.btn-outline-success {
    border-color: var(--success-line);
    background: var(--surface);
    color: var(--success);
}

.btn-outline-success:hover {
    border-color: var(--success) !important;
    background: var(--success-soft) !important;
    color: var(--success) !important;
}

.btn > .bx,
.btn > i.bx {
    font-size: 1.125rem;
    line-height: 1;
    vertical-align: -0.125em;
    margin-inline-end: 0.375rem;
}

.btn-link {
    min-height: 0;
    padding: 0;
    border: 0;
    color: var(--brand-700);
    font-weight: 600;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--brand-800);
    text-decoration: underline;
}

/* Icon buttons: quiet by default, coloured on hover. Used for row actions. */
.btn-icon {
    --btn-h: 2.125rem;
    width: 2.125rem;
    min-width: 2.125rem;
    height: 2.125rem;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-600);
    font-size: 1.125rem;
}

.btn-icon .bx,
.btn-icon > span {
    margin: 0 !important;
    font-size: 1.125rem;
    line-height: 1;
}

.btn-icon:hover,
.btn-icon:focus {
    border-color: var(--ink-300) !important;
    background: var(--ink-50) !important;
    color: var(--ink-900) !important;
}

.btn-icon.btn-primary,
.btn-icon.btn-outline-primary {
    color: var(--brand-600);
}

.btn-icon.btn-primary:hover,
.btn-icon.btn-outline-primary:hover {
    border-color: var(--brand-200) !important;
    background: var(--brand-50) !important;
    color: var(--brand-700) !important;
}

.btn-icon.btn-danger,
.btn-icon.btn-outline-danger {
    color: var(--danger);
}

.btn-icon.btn-danger:hover,
.btn-icon.btn-outline-danger:hover {
    border-color: var(--danger-line) !important;
    background: var(--danger-soft) !important;
    color: var(--danger) !important;
}

.btn-icon.btn-success,
.btn-icon.btn-outline-success {
    color: var(--success);
}

.btn-icon.btn-success:hover,
.btn-icon.btn-outline-success:hover {
    border-color: var(--success-line) !important;
    background: var(--success-soft) !important;
    color: var(--success) !important;
}

.btn-icon.btn-warning {
    color: var(--warning);
}

.btn-icon.btn-warning:hover {
    border-color: var(--warning-line) !important;
    background: var(--warning-soft) !important;
    color: var(--warning) !important;
}

.btn-icon.btn-secondary,
.btn-icon.btn-dark {
    color: var(--ink-600);
}

/* 4.3 Forms */
.form-label,
.col-form-label {
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink-700);
}

.form-control,
.form-select,
.input-group-text {
    min-height: 2.625rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--ink-300);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--ink-900);
    font-family: var(--font);
    font-size: 0.9375rem;
    line-height: 1.5;
    box-shadow: none;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

textarea.form-control {
    min-height: 6rem;
}

.form-control::placeholder {
    color: var(--ink-400);
    opacity: 1;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--ink-400);
}

.form-control:focus,
.form-select:focus,
.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
    border-color: var(--brand-500) !important;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus,
.input-group:focus-within {
    box-shadow: var(--ring) !important;
}

.input-group {
    border-radius: 8px;
}

.input-group:focus-within .form-control {
    box-shadow: none !important;
}

.input-group-text {
    color: var(--ink-500);
    background: var(--surface);
}

.form-select {
    padding-inline-end: 2.25rem;
    background-position: left 0.75rem center;
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--ink-100);
    color: var(--ink-500);
}

.form-text {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--ink-500);
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.2rem;
    border: 1.5px solid var(--ink-400);
    box-shadow: none !important;
}

.form-check-input:checked {
    border-color: var(--brand-600);
    background-color: var(--brand-600);
}

.form-check-input:focus {
    border-color: var(--brand-500);
    box-shadow: var(--ring) !important;
}

.form-switch .form-check-input {
    width: 2.25rem;
    height: 1.25rem;
}

.form-check-label {
    color: var(--ink-700);
}

.invalid-feedback {
    font-size: 0.8125rem;
    color: var(--danger);
}

.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: var(--danger);
}

/* 4.3b Form pages: a card of readable width whose fields share each row evenly */
.content-wrapper .card:has(> .card-body .row > [class*="col-"] > .form-label):not(:has(table)) {
    max-width: 60rem;
}

.content-wrapper .card > .card-body > .row:has(> [class*="col-"] > .form-label),
.content-wrapper .card > .card-body > form > .row:has(> [class*="col-"] > .form-label) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 0 1.25rem;
    margin: 0;
}

.content-wrapper .card > .card-body > .row:has(> [class*="col-"] > .form-label) > [class*="col-"],
.content-wrapper .card > .card-body > form > .row:has(> [class*="col-"] > .form-label) > [class*="col-"] {
    width: auto;
    max-width: none;
    padding: 0;
}

.card-body h6.text-muted {
    margin: 0.75rem 0 1rem !important;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ink-100);
    color: var(--ink-800) !important;
    font-size: 0.9375rem;
    font-weight: 600;
}

.form-check-inline {
    margin-inline-end: 1.25rem;
}

/* 4.4 Tables */
.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
    color: var(--ink-700);
    border-color: var(--ink-100);
    font-size: 0.875rem;
}

.table td .btn-icon + .btn-icon,
.table td .btn-icon + a.btn-icon,
.table td a.btn-icon + .btn-icon {
    margin-inline-start: 0.25rem;
}

.table td .btn-icon {
    margin: 0 !important;
}

.table > :not(caption) > * > * {
    padding: 0.8125rem 1rem;
    border-bottom: 1px solid var(--ink-100);
    box-shadow: none;
    vertical-align: middle;
}

.table > thead > tr > th,
.table thead th {
    padding-block: 0.6875rem;
    border-bottom: 1px solid var(--ink-200) !important;
    background: var(--ink-50);
    color: var(--ink-600);
    font-size: 0.78125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.table > tbody > tr:last-child > * {
    border-bottom: 0;
}

.table > tbody > tr {
    transition: background-color 0.12s var(--ease);
}

.table > tbody > tr:hover > * {
    background: var(--ink-50);
}

.table a {
    font-weight: 600;
}

.card > .table-responsive,
.card > .card-datatable {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 4.5 DataTables (list pages) */
.dataTables_wrapper {
    padding: 0;
    font-size: 0.875rem;
}

.dataTables_wrapper > .row {
    align-items: center;
    margin: 0;
    padding: 0.875rem 1rem;
}

.dataTables_wrapper > .row:nth-child(2) {
    padding: 0;
}

.dataTables_wrapper > .row > [class*="col-"] {
    padding-inline: 0.375rem;
}

.dataTables_wrapper > .row:nth-child(2) > [class*="col-"] {
    padding: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    float: none !important;
    padding: 0 !important;
    color: var(--ink-500);
    text-align: start !important;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_paginate {
    text-align: end !important;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-weight: 500;
    color: var(--ink-600);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    min-height: 2.375rem;
    margin: 0 !important;
    border: 1px solid var(--ink-300);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--ink-900);
    font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_filter input {
    width: 16rem;
    max-width: 100%;
    padding: 0.375rem 0.75rem;
    padding-inline-start: 2.25rem;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 0.625rem center;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--brand-500);
    box-shadow: var(--ring);
    outline: 0;
}

table.dataTable {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

table.dataTable thead > tr > th,
table.dataTable thead > tr > td {
    padding-inline: 1rem !important;
    border-top: 1px solid var(--ink-200);
}

table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after {
    inset-inline-end: auto !important;
    inset-inline-start: 0.25rem !important;
    right: auto;
    opacity: 0.35;
}

table.dataTable.no-footer {
    border-bottom: 1px solid var(--ink-100) !important;
}

.dataTables_wrapper .dataTables_processing {
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--ink-600);
}

.dataTables_empty {
    padding: 2.5rem 1rem !important;
    color: var(--ink-500);
    text-align: center !important;
}

/* 4.5b DataTables 2 (the build the list pages load): controls, table, footer */
.dt-container {
    padding: 0;
    font-size: 0.875rem;
}

.dt-container > .row {
    --bs-gutter-x: 0;
    align-items: center;
    gap: 0.5rem 1rem;
    margin: 0 !important;
    padding: 0.875rem 1.375rem;
}

.dt-container > .row > [class*="col-"] {
    padding: 0;
}

.dt-container > .row:empty,
.dt-container > .row > [class*="col-"]:empty {
    display: none;
}

/* the table scrolls sideways on its own; the controls above and below stay put */
.dt-container > .row.justify-content-md-center {
    padding: 0;
}

.dt-container > .row.justify-content-md-center > .col-12 {
    overflow-x: auto;
}

.card > .table-responsive:has(> .dt-container),
.table-framed:has(> .dt-container) {
    overflow: visible;
}

.dt-container .dt-length,
.dt-container .dt-search,
.dt-container .dt-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-600);
    font-weight: 500;
}

.dt-container .dt-info {
    padding: 0 !important;
    color: var(--ink-500);
    font-weight: 400;
}

.dt-container .dt-length label,
.dt-container .dt-search label {
    margin: 0;
}

.dt-container .dt-length select,
.dt-container .dt-search input {
    min-height: 2.375rem;
    margin: 0 !important;
    border: 1px solid var(--ink-300);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--ink-900);
    font-size: 0.875rem;
}

.dt-container .dt-length select {
    width: auto;
    padding-block: 0.25rem;
}

.dt-container .dt-search input {
    width: 16rem;
    max-width: 100%;
    padding: 0.375rem 0.75rem;
    padding-inline-start: 2.25rem;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 0.625rem center;
}

.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus {
    border-color: var(--brand-500);
    box-shadow: var(--ring);
    outline: 0;
}

.dt-container table.dataTable {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
}

.dt-container table.dataTable > thead > tr > th {
    border-top: 1px solid var(--ink-200);
}

.dt-container table.dataTable > * > tr > * {
    padding-inline: 0.75rem;
}

.dt-container table.dataTable > * > tr > :first-child {
    padding-inline-start: 1.375rem;
}

.dt-container table.dataTable > * > tr > :last-child {
    padding-inline-end: 1.375rem;
}

.dt-container table.dataTable > tbody > tr:last-child > td {
    border-bottom: 1px solid var(--ink-100);
}

/* sort arrows: quiet, on the far side of the label */
.dt-container table.dataTable thead .dt-column-order {
    inset-inline-end: auto !important;
    inset-inline-start: 0.375rem !important;
    right: auto;
    opacity: 0.6;
}

.dt-container .dt-paging .pagination {
    margin: 0;
}

.dt-container .dt-empty {
    padding: 2.5rem 1rem !important;
    color: var(--ink-500);
    text-align: center !important;
}

.dt-container .dt-processing {
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--ink-600);
}

/* Row actions stay in view while the other columns scroll under them. */
@media (min-width: 992px) {
    .dt-container table.dataTable > thead > tr > th:last-child,
    .dt-container table.dataTable > tbody > tr > td:last-child {
        position: sticky;
        inset-inline-end: 0;
        z-index: 1;
    }

    .dt-container table.dataTable > tbody > tr > td:last-child {
        background: var(--surface);
        box-shadow: 1px 0 0 var(--ink-100);
    }

    .dt-container table.dataTable > tbody > tr:hover > td:last-child {
        background: var(--ink-50);
    }

    /* a row whose menu is open sits above the rows below it */
    .dt-container table.dataTable > tbody > tr > td:last-child:has(.dropdown-menu.show) {
        z-index: 6;
    }
}

/* 4.6 Pagination */
.pagination {
    gap: 0.25rem;
    margin: 0;
    justify-content: flex-end;
}

.page-item .page-link {
    min-width: 2.125rem;
    height: 2.125rem;
    padding: 0 0.625rem;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 8px !important;
    background: transparent;
    color: var(--ink-600);
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: none !important;
}

.page-item:not(.active):not(.disabled) .page-link:hover {
    border-color: var(--ink-200);
    background: var(--surface);
    color: var(--ink-900);
}

.page-item.active .page-link {
    border-color: var(--brand-600) !important;
    background: var(--brand-600) !important;
    color: #fff !important;
}

.page-item.disabled .page-link {
    color: var(--ink-300);
}

/* 4.7 Badges */
.badge {
    padding: 0.3125em 0.625em;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.badge.bg-label-primary,
.badge.bg-primary,
.badge.btn-primary {
    background: var(--brand-50) !important;
    color: var(--brand-700) !important;
    border: 1px solid var(--brand-100);
}

.badge.bg-label-success,
.badge.bg-success {
    background: var(--success-soft) !important;
    color: var(--success) !important;
    border: 1px solid var(--success-line);
}

.badge.bg-label-warning,
.badge.bg-warning {
    background: var(--warning-soft) !important;
    color: var(--warning) !important;
    border: 1px solid var(--warning-line);
}

.badge.bg-label-danger {
    background: var(--danger-soft) !important;
    color: var(--danger) !important;
    border: 1px solid var(--danger-line);
}

.badge.bg-label-secondary,
.badge.bg-secondary {
    background: var(--ink-100) !important;
    color: var(--ink-600) !important;
    border: 1px solid var(--ink-200);
}

.badge.bg-label-info,
.badge.bg-info {
    background: var(--info-soft) !important;
    color: var(--info) !important;
    border: 1px solid var(--info-line);
}

/* 4.8 Dropdowns */
.dropdown-menu {
    padding: 0.375rem;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    text-align: start;
}

.dropdown-item {
    padding: 0.5rem 0.75rem;
    border-radius: 7px;
    color: var(--ink-700);
    font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--ink-100);
    color: var(--ink-900);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--brand-50);
    color: var(--brand-700);
}

.dropdown-item > .bx {
    margin-inline-end: 0.5rem;
    color: var(--ink-500);
    font-size: 1.0625rem;
    vertical-align: -0.15em;
}

.dropdown-item.text-danger > .bx {
    color: inherit;
}

.table .dropdown-item {
    font-weight: 500;
}

button.dropdown-item {
    border: 0;
    background: none;
    font: inherit;
    text-align: start;
}

.dropdown-divider {
    margin: 0.375rem 0;
    border-color: var(--ink-100);
}

/* 4.9 Modals */
.modal-backdrop {
    background: var(--ink-900);
}

.modal-backdrop.show {
    opacity: 0.45;
}

.modal-content {
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    padding: 1.125rem 1.375rem;
    border-bottom: 1px solid var(--ink-100);
    align-items: center;
}

.modal-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink-900);
}

.modal-body {
    padding: 1.375rem;
}

.modal-footer {
    padding: 1rem 1.375rem;
    gap: 0.5rem;
    border-top: 1px solid var(--ink-100);
    background: var(--ink-50);
}

.modal-footer > * {
    margin: 0;
}

.btn-close,
.modal .btn-close,
.modal .modal-header .btn-close {
    flex: 0 0 auto;
    margin: 0;
    margin-inline-start: auto;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: transparent;
    box-shadow: none !important;
    opacity: 0.55;
    transform: none !important;
    transition: background-color 0.15s var(--ease), opacity 0.15s var(--ease);
}

.btn-close:hover,
.modal .btn-close:hover,
.modal .btn-close:focus {
    background-color: var(--ink-100);
    opacity: 1;
    transform: none !important;
}

.modal-header {
    gap: 1rem;
}

/* 4.10 Alerts */
.alert {
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: var(--success);
}

.alert-danger {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.alert-warning {
    border-color: var(--warning-line);
    background: var(--warning-soft);
    color: var(--warning);
}

.alert-info,
.alert-primary {
    border-color: var(--brand-100);
    background: var(--brand-50);
    color: var(--brand-800);
}

/* 4.11 Progress */
.progress {
    height: 0.5rem;
    border-radius: 999px;
    background: var(--ink-100);
    box-shadow: none;
}

.progress-bar {
    border-radius: 999px;
    background-color: var(--brand-600);
    box-shadow: none;
    font-size: 0.6875rem;
    font-weight: 600;
}

/* 4.12 SweetAlert dialogs */
/* above side panels (offcanvas 1090) and modals, so a dialog opened from a panel is on top and clickable */
.swal2-container {
    z-index: 2050 !important;
}

.swal2-popup {
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: var(--radius-lg);
    font-family: var(--font);
    box-shadow: var(--shadow-lg);
}

.swal2-title {
    font-size: 1.1875rem;
    font-weight: 600;
    color: var(--ink-900);
}

.swal2-html-container {
    font-size: 0.9375rem;
    color: var(--ink-600);
}

.swal2-actions {
    gap: 0.5rem;
}

.swal2-styled {
    margin: 0;
    min-height: 2.5rem;
    padding: 0.4375rem 1.125rem;
    border-radius: 8px !important;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: none !important;
}

.swal2-styled.swal2-confirm {
    background: var(--brand-600) !important;
}

.swal2-styled.swal2-cancel,
.swal2-styled.swal2-deny {
    border: 1px solid var(--ink-300) !important;
    background: var(--surface) !important;
    color: var(--ink-700) !important;
}

/* 4.13 Building blocks used by the redesigned pages */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink-900);
}

.page-header__lead {
    margin: 0.25rem 0 0;
    color: var(--ink-500);
    font-size: 0.9375rem;
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-tile {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1.125rem 1.25rem;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

a.stat-tile--link {
    color: inherit;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}

a.stat-tile--link:hover {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
    color: inherit;
    transform: translateY(-1px);
}

.stat-tile__icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    border-radius: 11px;
    background: var(--brand-50);
    color: var(--brand-600);
    font-size: 1.375rem;
}

.stat-tile__label {
    margin: 0;
    color: var(--ink-500);
    font-size: 0.8125rem;
    font-weight: 500;
}

.stat-tile__value {
    margin: 0.125rem 0 0;
    color: var(--ink-900);
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.25;
}

.stat-tile__hint {
    margin: 0.125rem 0 0;
    color: var(--ink-500);
    font-size: 0.78125rem;
}

.trend-up {
    color: var(--success);
    font-weight: 600;
}

.trend-down {
    color: var(--danger);
    font-weight: 600;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    padding: 3rem 1.5rem;
    color: var(--ink-500);
    text-align: center;
}

.empty-state__icon {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--ink-100);
    color: var(--ink-400);
    font-size: 1.75rem;
}

.empty-state__title {
    margin: 0.25rem 0 0;
    color: var(--ink-800);
    font-size: 1rem;
    font-weight: 600;
}

.list-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list-rows > li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--ink-100);
}

.list-rows > li:last-child {
    border-bottom: 0;
}

/* 4.14 Dashboard blocks */
.card-header--split {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.card-subtitle,
.modal-subtitle {
    margin: 0.125rem 0 0;
    color: var(--ink-500);
    font-size: 0.8125rem;
    font-weight: 400;
}

.card-link {
    font-size: 0.8125rem;
    font-weight: 600;
}

/* a label and its control on one line */
.inline-field {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--ink-600);
    font-size: 0.8125rem;
    font-weight: 600;
}

.inline-field .form-select {
    width: auto;
    min-width: 11rem;
    max-width: 20rem;
}

.form-select-sm {
    min-height: 2.125rem;
    padding-block: 0.25rem;
    font-size: 0.875rem;
}

.chart-area {
    min-height: 360px;
}

.chart-caption {
    margin: 0 0 0.75rem;
    color: var(--ink-600);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* signed change against a named period */
.delta {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    font-weight: 600;
}

.delta .bx {
    font-size: 1rem;
}

.delta--up {
    color: var(--success);
}

.delta--down {
    color: var(--danger);
}

/* people, newest first */
.person-list {
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
}

.person-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6875rem 1.375rem;
    border-bottom: 1px solid var(--ink-100);
}

.person-row:last-child {
    border-bottom: 0;
}

.person-row__main {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

.person-row__name {
    overflow: hidden;
    color: var(--ink-900);
    font-size: 0.875rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-row__meta {
    overflow: hidden;
    color: var(--ink-500);
    font-size: 0.78125rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-row__time {
    flex: 0 0 auto;
    color: var(--ink-500);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* the clustering result: two figures beside the share of each group */
.training-summary {
    display: grid;
    grid-template-columns: minmax(11rem, 0.32fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.training-summary__figures {
    display: grid;
    gap: 1.25rem;
    padding-inline-end: 2rem;
    border-inline-end: 1px solid var(--ink-100);
}

.figure {
    display: grid;
    gap: 0.125rem;
}

.figure__value {
    color: var(--ink-900);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.figure__label {
    color: var(--ink-500);
    font-size: 0.8125rem;
    font-weight: 500;
}

.share-bars {
    display: grid;
    gap: 0.5rem;
}

.share-bars__row {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr) 5rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 6px;
}

.share-bars__row:hover {
    background: var(--ink-50);
}

.share-bars__name {
    color: var(--ink-800);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.share-bars__plot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

/* a bar grows from the reading edge; only its far end is rounded */
.share-bars__bar {
    flex: 0 1 auto;
    height: 14px;
    min-width: 2px;
    border-start-end-radius: 4px;
    border-end-end-radius: 4px;
    background: var(--brand-600);
}

.share-bars__value {
    flex: 0 0 auto;
    color: var(--ink-900);
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.share-bars__count {
    color: var(--ink-500);
    font-size: 0.78125rem;
    font-variant-numeric: tabular-nums;
    text-align: end;
    white-space: nowrap;
}

.share-bars--counts .share-bars__row {
    grid-template-columns: minmax(6.5rem, 10rem) minmax(0, 1fr);
}

.person-list--scroll {
    max-height: 30rem;
    overflow-y: auto;
}

.person-row--wrap {
    flex-wrap: wrap;
}

.person-row__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.badge > .bx {
    margin-inline-end: 0.25rem;
    font-size: 0.875rem;
    vertical-align: -0.125em;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* scores as aligned rows: name, bar, figure */
.meter-list {
    display: grid;
    gap: 0.625rem;
}

.meter-row {
    display: grid;
    grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) 3.5rem;
    align-items: center;
    gap: 0.875rem;
}

.meter-row__name {
    color: var(--ink-600);
    font-size: 0.875rem;
    line-height: 1.4;
}

.meter-row__track {
    display: block;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--brand-50);
}

.meter-row__fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--brand-300);
}

.meter-row__value {
    color: var(--ink-700);
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: end;
}

.meter-row--top .meter-row__name {
    color: var(--ink-900);
    font-weight: 600;
}

.meter-row--top .meter-row__fill {
    background: var(--brand-600);
}

.meter-row--top .meter-row__value {
    color: var(--ink-900);
}

/* controls above a table inside a dialog */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table-framed {
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    overflow: hidden;
}

/* suggested projects */
.project-list {
    display: grid;
    gap: 0.75rem;
}

.project-card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    background: var(--surface);
}

.project-card__index {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 0.8125rem;
    font-weight: 700;
}

.project-card__body {
    display: grid;
    justify-items: start;
    gap: 0.375rem;
    min-width: 0;
}

.project-card__name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.project-card__reason {
    margin: 0;
    color: var(--ink-600);
    font-size: 0.875rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.project-card__tag {
    padding: 0.0625rem 0.5rem;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5rem;
}

.loading-note {
    display: grid;
    gap: 0.875rem;
    padding: 1.5rem 0.5rem;
    color: var(--ink-500);
    font-size: 0.875rem;
    text-align: center;
}

.loading-note p {
    margin: 0;
}

/* waiting for the language model */
.ai-thinking {
    display: grid;
    justify-items: center;
    gap: 0.375rem;
    padding: 2.25rem 1rem 1.75rem;
    text-align: center;
}

.ai-thinking__orb {
    position: relative;
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 0.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-500), #8b5cf6);
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.8);
}

.ai-thinking__orb::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--brand-200);
    animation: ai-pulse 1.6s var(--ease) infinite;
}

.ai-thinking__title {
    margin: 0;
    color: var(--ink-900);
    font-weight: 600;
}

.ai-thinking__hint {
    margin: 0;
    color: var(--ink-500);
    font-size: 0.8125rem;
}

.ai-thinking__lines {
    display: grid;
    gap: 0.5rem;
    width: min(100%, 26rem);
    margin-top: 1.25rem;
}

.ai-thinking__lines span {
    height: 0.625rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ink-100) 0%, var(--brand-50) 50%, var(--ink-100) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

.ai-thinking__lines span:nth-child(2) { width: 85%; }
.ai-thinking__lines span:nth-child(3) { width: 60%; }

@keyframes ai-pulse {
    0% { transform: scale(0.9); opacity: 0.9; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.ai-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--ink-100);
}

.ai-meta__info {
    color: var(--ink-500);
    font-size: 0.78125rem;
    font-variant-numeric: tabular-nums;
}

.empty-state__icon--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

/* chart tooltips and legends follow the page */
.apexcharts-tooltip {
    border: 1px solid var(--ink-200) !important;
    border-radius: 8px !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-md) !important;
    color: var(--ink-800);
}

.apexcharts-tooltip-title {
    margin-bottom: 0 !important;
    border-bottom: 1px solid var(--ink-100) !important;
    background: var(--ink-50) !important;
    color: var(--ink-600);
    font-weight: 600;
}

.apexcharts-legend-text {
    padding-inline-start: 0.25rem;
}

.apexcharts-tooltip-marker {
    margin-right: 0 !important;
    margin-inline-end: 0.5rem !important;
}

@media (max-width: 767.98px) {
    .training-summary {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .training-summary__figures {
        grid-template-columns: 1fr 1fr;
        padding-inline-end: 0;
        padding-bottom: 1.25rem;
        border-inline-end: 0;
        border-bottom: 1px solid var(--ink-100);
    }

    .share-bars__row {
        grid-template-columns: 5.5rem minmax(0, 1fr);
    }

    .share-bars__count {
        display: none;
    }

    .meter-row {
        grid-template-columns: minmax(0, 1fr) 3.5rem;
    }

    .meter-row__name {
        grid-column: 1 / -1;
    }

    .inline-field .form-select {
        min-width: 0;
    }
}

/* 4.15 Participant area */
.app-topbar__brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--ink-900);
    font-size: 1.0625rem;
    font-weight: 700;
}

.app-topbar__brand:hover {
    color: var(--ink-900);
}

.layout-without-menu .layout-page {
    padding-inline: 0 !important;
}

.content-wrapper > .participant-content {
    max-width: 1180px;
}

.attempt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr));
    gap: 1.25rem;
}

.attempt-card .card-body {
    flex: 1 1 auto;
}

/* 4.16 Shared pieces of the newer pages ---------------------------------------- */

/* tabs between the pages of one area (AI centre, analysis) */
.page-tabs {
    display: flex;
    gap: 0.25rem;
    margin: -0.25rem 0 1.5rem;
    padding: 0.25rem;
    overflow-x: auto;
    border: 1px solid var(--ink-200);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    scrollbar-width: none;
}

.page-tabs a {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 9px;
    color: var(--ink-600);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.page-tabs a:hover {
    background: var(--ink-50);
    color: var(--ink-900);
}

.page-tabs a.active {
    background: var(--brand-600);
    color: #fff;
    box-shadow: 0 6px 14px -8px rgba(79, 70, 229, 0.9);
}

.page-tabs a .bx {
    font-size: 1.125rem;
}

/* loading placeholders: the shape of the content, gently shimmering */
.skeleton {
    display: block;
    min-height: 0.875rem;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--ink-100) 0%, var(--ink-50) 50%, var(--ink-100) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
    color: transparent !important;
}

.skeleton--value {
    width: 5.5rem;
    height: 1.75rem;
    margin-top: 0.25rem;
}

.skeleton--line {
    width: 70%;
    height: 0.75rem;
    margin-top: 0.5rem;
}

/* a small status light with its label */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.status-dot::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--ink-400);
    box-shadow: 0 0 0 3px var(--ink-100);
}

.status-dot--ok { color: var(--success); }
.status-dot--ok::before { background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }
.status-dot--bad { color: var(--danger); }
.status-dot--bad::before { background: #ef4444; box-shadow: 0 0 0 3px #fee2e2; }
.status-dot--wait { color: var(--ink-500); }
.status-dot--wait::before { animation: blink 1s ease-in-out infinite; }

@keyframes blink {
    50% { opacity: 0.25; }
}

/* buttons busy with a request */
.btn.is-busy {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.is-busy::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 1rem;
    height: 1rem;
    margin: auto;
    border: 2px solid currentColor;
    border-color: rgba(255, 255, 255, 0.95) rgba(255, 255, 255, 0.95) rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-secondary.is-busy::after,
.btn-outline-primary.is-busy::after,
.btn-outline-danger.is-busy::after {
    border-color: var(--ink-600) var(--ink-600) var(--ink-200) var(--ink-200);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* toasts: short confirmations that do not interrupt */
.toast-stack {
    position: fixed;
    inset-block-end: 1.25rem;
    inset-inline-start: 50%;
    z-index: 2000;
    display: grid;
    gap: 0.5rem;
    width: min(26rem, calc(100vw - 2rem));
    transform: translateX(50%);
    pointer-events: none;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    border-radius: 12px;
    background: var(--ink-900);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 0.25s var(--ease);
}

.app-toast .bx {
    flex: 0 0 auto;
    margin-top: 0.125rem;
    font-size: 1.125rem;
}

.app-toast--success .bx { color: #34d399; }
.app-toast--error .bx { color: #f87171; }
.app-toast--info .bx { color: var(--brand-200); }
.app-toast.is-leaving { animation: toast-out 0.2s var(--ease) forwards; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(0.5rem) scale(0.98); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(0.25rem); }
}

/* side drawer (Bootstrap offcanvas) */
.offcanvas {
    border: 0 !important;
    box-shadow: var(--shadow-lg);
}

.offcanvas.offcanvas-start,
.offcanvas.offcanvas-end {
    width: min(40rem, 100vw);
}

.offcanvas-header {
    padding: 1.125rem 1.375rem;
    border-bottom: 1px solid var(--ink-100);
}

.offcanvas-title {
    font-size: 1.0625rem;
    font-weight: 600;
}

.offcanvas-body {
    padding: 1.375rem;
}

/* label / value pairs */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: 0.875rem 1.25rem;
    margin: 0;
}

.facts dt {
    margin-bottom: 0.125rem;
    color: var(--ink-500);
    font-size: 0.75rem;
    font-weight: 500;
}

.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink-900);
    font-size: 0.875rem;
    font-weight: 600;
}

/* monospace blocks for prompts and raw answers */
.code-block {
    margin: 0;
    padding: 0.875rem 1rem;
    max-height: 22rem;
    overflow: auto;
    border: 1px solid var(--ink-200);
    border-radius: 10px;
    background: var(--ink-50);
    color: var(--ink-800);
    /* prompts and answers are mostly Arabic prose: keep the interface font */
    font-family: var(--font);
    font-size: 0.8125rem;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
    unicode-bidi: plaintext;
    text-align: start;
}

.section-title {
    margin: 1.5rem 0 0.625rem;
    color: var(--ink-500);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* rows of label, bar and figures (spending by admin, by model, …) */
.bar-list {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bar-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.25rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--ink-100);
}

.bar-list li:last-child {
    border-bottom: 0;
}

.bar-list__name {
    overflow: hidden;
    color: var(--ink-800);
    font-size: 0.875rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-list__figure {
    color: var(--ink-900);
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: end;
}

.bar-list__track {
    grid-column: 1 / -1;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--brand-50);
}

.bar-list__track > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--brand-600);
}

.bar-list__meta {
    grid-column: 1 / -1;
    color: var(--ink-500);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/* a setting row: text on one side, its control on the other */
.setting-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding: 1.125rem 0;
    border-bottom: 1px solid var(--ink-100);
}

.setting-row:first-child {
    padding-top: 0;
}

.setting-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.setting-row__text {
    flex: 1 1 18rem;
    min-width: 0;
}

.setting-row__title {
    margin: 0;
    color: var(--ink-900);
    font-size: 0.9375rem;
    font-weight: 600;
}

.setting-row__hint {
    margin: 0.125rem 0 0;
    color: var(--ink-500);
    font-size: 0.8125rem;
}

.setting-row__control {
    flex: 0 1 22rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.input-suffix {
    position: relative;
    flex: 1 1 auto;
}

.input-suffix > .form-control {
    padding-inline-end: 2.5rem;
}

.input-suffix > span {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0.875rem;
    display: grid;
    place-items: center;
    color: var(--ink-500);
    font-size: 0.875rem;
    pointer-events: none;
}

/* a searchable picker (models) */
.picker {
    position: relative;
}

.picker__menu {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 0.375rem);
    z-index: 30;
    max-height: 20rem;
    overflow-y: auto;
    padding: 0.375rem;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.picker__option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.125rem 0.75rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--ink-800);
    text-align: start;
    cursor: pointer;
}

.picker__option:hover,
.picker__option.is-active {
    background: var(--brand-50);
}

.picker__option strong {
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: end;
}

.picker__option small {
    grid-column: 1 / -1;
    color: var(--ink-500);
    font-size: 0.75rem;
}

.picker__option em {
    color: var(--ink-500);
    font-size: 0.75rem;
    font-style: normal;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.picker__empty {
    padding: 1rem;
    color: var(--ink-500);
    font-size: 0.8125rem;
    text-align: center;
}

.ltr {
    direction: ltr;
    unicode-bidi: isolate;
}

.money {
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
}

.form-switch-lg .form-check-input {
    width: 2.75rem;
    height: 1.5rem;
    margin: 0;
    cursor: pointer;
}

.callout {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--brand-100);
    border-radius: var(--radius);
    background: var(--brand-50);
    color: var(--brand-800);
    font-size: 0.875rem;
}

.callout .bx {
    flex: 0 0 auto;
    margin-top: 0.125rem;
    font-size: 1.25rem;
}

.callout--warning {
    border-color: var(--warning-line);
    background: var(--warning-soft);
    color: #92400e;
}

.order-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.order-steps li {
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--brand-200);
    border-radius: 999px;
    background: var(--surface);
    color: var(--brand-800);
    font-size: 0.75rem;
    font-weight: 600;
}

.order-steps li + li::before {
    content: "←";
    margin-inline-end: 0.5rem;
    color: var(--brand-400);
}

/* filter row above a table */
.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.625rem;
    padding: 1rem 1.375rem;
    border-bottom: 1px solid var(--ink-100);
}

.filters .form-select,
.filters .form-control {
    width: auto;
    max-width: 14rem;
}

.filters__summary {
    margin-inline-start: auto;
    color: var(--ink-600);
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

tr.row-link {
    cursor: pointer;
}

tr.row-link:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: -2px;
}

/* a large meter: used against limit */
.meter-big__track {
    height: 0.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--brand-50);
}

.meter-big__track > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-700));
    transition: width 0.6s var(--ease);
}

.meter-big__legend {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    color: var(--ink-500);
    font-size: 0.8125rem;
}

.meter-big__legend strong {
    color: var(--ink-900);
}

/* segmented choice (radio buttons that look like one control) */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--ink-200);
    border-radius: 10px;
    background: var(--ink-50);
}

.segmented label {
    margin: 0;
    cursor: pointer;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: block;
    padding: 0.375rem 0.875rem;
    border-radius: 7px;
    color: var(--ink-600);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.segmented input:checked + span {
    background: var(--surface);
    color: var(--ink-900);
    box-shadow: var(--shadow-sm);
}

.segmented input:focus-visible + span {
    outline: 2px solid var(--brand-500);
    outline-offset: 1px;
}

/* 4.17 Prompt templates ------------------------------------------------------------ */
.prompts-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.prompts-usage {
    margin: 0;
    color: var(--ink-500);
    font-size: 0.8125rem;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: 1rem;
}

.template-grid > .empty-state {
    grid-column: 1 / -1;
}

.template-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.125rem 1.25rem 1rem;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}

.template-card:hover {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.template-card:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

.template-card.is-inactive {
    opacity: 0.65;
}

.template-card__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.template-card__icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--brand-50);
    color: var(--brand-600);
    font-size: 1.25rem;
}

.template-card__titles {
    min-width: 0;
}

.template-card__name {
    margin: 0;
    overflow: hidden;
    font-size: 0.9375rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-card__purpose {
    margin: 0;
    color: var(--ink-500);
    font-size: 0.75rem;
}

.template-card__description {
    flex: 1 1 auto;
    margin: 0;
    color: var(--ink-600);
    font-size: 0.8125rem;
    line-height: 1.7;
}

.template-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.template-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ink-100);
}

.template-card__meta {
    color: var(--ink-500);
    font-size: 0.75rem;
}

.template-card__actions {
    display: flex;
    gap: 0.25rem;
}

/* the wide drawer with a form and a live preview */
.offcanvas.offcanvas-wide {
    width: min(68rem, 100vw);
}

.offcanvas-wide .offcanvas-body {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

.offcanvas-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.875rem 1.375rem;
    border-top: 1px solid var(--ink-100);
    background: var(--ink-50);
}

.req {
    color: var(--danger);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--brand-100);
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-800);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.chip:hover {
    border-color: var(--brand-400);
    background: var(--brand-100);
}

.chip code {
    color: var(--brand-600);
    font-size: 0.6875rem;
}

.editor__body {
    font-size: 0.9375rem;
    line-height: 1.8;
}

.editor__advanced {
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
}

.editor__advanced summary {
    color: var(--ink-800);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.editor__switches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-top: 1.25rem;
}

.editor__switches .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
}

.editor__switches .form-check-input {
    float: none;
    margin: 0;
}

.editor__preview {
    position: sticky;
    top: 0;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: var(--ink-50);
}

.editor__preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.editor__preview .code-block {
    max-height: 18rem;
    background: var(--surface);
}

.editor__warning {
    margin-bottom: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 0.8125rem;
    font-weight: 600;
}

.ai-thinking--compact {
    padding: 1.25rem 0.5rem;
}

.ai-thinking--compact .ai-thinking__orb {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.125rem;
}

/* model answers written in Markdown */
.md-answer {
    color: var(--ink-800);
    font-size: 0.9375rem;
    line-height: 1.85;
}

.md-answer h3,
.md-answer h4,
.md-answer h5,
.md-answer h6 {
    margin: 1rem 0 0.375rem;
    font-size: 1rem;
    font-weight: 700;
}

.md-answer > :first-child {
    margin-top: 0;
}

.md-answer p {
    margin: 0 0 0.625rem;
}

.md-answer ul,
.md-answer ol {
    margin: 0 0 0.75rem;
    padding-inline-start: 1.25rem;
}

.md-answer li {
    margin-bottom: 0.25rem;
}

.md-answer code {
    padding: 0.0625rem 0.3125rem;
    border-radius: 4px;
    background: var(--ink-100);
    color: var(--ink-800);
    font-size: 0.8125rem;
}

.md-answer hr {
    margin: 1rem 0;
    border-color: var(--ink-200);
}

.md-table {
    margin: 0.5rem 0 0.875rem;
    overflow-x: auto;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
}

.md-table .table {
    font-size: 0.8125rem;
}

@media (max-width: 991.98px) {
    .offcanvas-wide .offcanvas-body {
        grid-template-columns: 1fr;
    }

    .editor__preview {
        position: static;
    }
}

/* 4.18 Result analysis ----------------------------------------------------------- */
.page-header__eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.page-header__eyebrow a {
    color: var(--ink-500);
}

.page-header__eyebrow a::after {
    content: " /";
    color: var(--ink-300);
}

.btn-ai {
    border: 0;
    background: linear-gradient(135deg, var(--brand-600), #7c3aed);
    box-shadow: 0 8px 20px -10px rgba(99, 102, 241, 0.9) !important;
}

.btn-ai:hover,
.btn-ai:focus {
    background: linear-gradient(135deg, var(--brand-700), #6d28d9) !important;
}

.stat-tile__value--text {
    font-size: 1.25rem;
    line-height: 1.6;
}

.stat-tile__value small {
    color: var(--ink-400);
    font-size: 0.875rem;
    font-weight: 600;
}

.section-nav {
    position: sticky;
    top: calc(var(--topbar-height) + 0.75rem);
    z-index: 20;
}

.report-section {
    margin-top: 1.5rem;
    scroll-margin-top: calc(var(--topbar-height) + 5rem);
}

h2.card-title {
    font-size: 1.0625rem;
}

/* findings */
.findings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
    gap: 0.625rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.finding {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0;
    color: var(--ink-800);
    font-size: 0.9375rem;
    line-height: 1.75;
}

.finding__icon {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 9px;
    background: var(--ink-100);
    color: var(--ink-600);
    font-size: 1.0625rem;
}

.finding--good .finding__icon { background: var(--success-soft); color: var(--success); }
.finding--warn .finding__icon { background: var(--warning-soft); color: var(--warning); }
.finding--info .finding__icon { background: var(--brand-50); color: var(--brand-600); }

/* capability profile: a box-plot per row */
.range-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1rem;
    color: var(--ink-500);
    font-size: 0.75rem;
}

.range-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.range-legend i {
    display: inline-block;
}

.range-legend__whisker { width: 1.25rem; height: 2px; background: var(--ink-300); }
.range-legend__band { width: 1.25rem; height: 0.625rem; border-radius: 3px; background: var(--brand-200); }
.range-legend__median { width: 2px; height: 0.875rem; background: var(--brand-800); }
.range-legend__mean { width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--brand-600); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--brand-600); }

.range-axis,
.range-row > summary {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr) 3rem 3.25rem;
    align-items: center;
    gap: 0.875rem;
}

.range-axis {
    padding-inline-start: 7.875rem;
    padding-inline-end: 8rem;
    display: flex;
    justify-content: space-between;
    color: var(--ink-400);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}

.range-row {
    border-top: 1px solid var(--ink-100);
}

.range-row > summary {
    padding: 0.625rem 0.25rem;
    list-style: none;
    cursor: pointer;
    border-radius: 6px;
}

.range-row > summary::-webkit-details-marker {
    display: none;
}

.range-row > summary:hover {
    background: var(--ink-50);
}

.range-row__name {
    overflow: hidden;
    color: var(--ink-900);
    font-size: 0.875rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.range-row__plot {
    position: relative;
    height: 1.5rem;
    background: linear-gradient(90deg, transparent calc(25% - 0.5px), var(--ink-100) calc(25% - 0.5px), var(--ink-100) calc(25% + 0.5px), transparent calc(25% + 0.5px), transparent calc(50% - 0.5px), var(--ink-100) calc(50% - 0.5px), var(--ink-100) calc(50% + 0.5px), transparent calc(50% + 0.5px), transparent calc(75% - 0.5px), var(--ink-100) calc(75% - 0.5px), var(--ink-100) calc(75% + 0.5px), transparent calc(75% + 0.5px));
}

.range-row__plot > span {
    position: absolute;
    top: 50%;
}

.range-row__whisker {
    height: 2px;
    margin-top: -1px;
    background: var(--ink-300);
}

.range-row__band {
    height: 0.75rem;
    margin-top: -0.375rem;
    border-radius: 3px;
    background: var(--brand-200);
}

.range-row__median {
    width: 2px;
    height: 1rem;
    margin-top: -0.5rem;
    margin-inline-start: -1px;
    background: var(--brand-800);
}

.range-row__mean {
    width: 0.75rem;
    height: 0.75rem;
    margin-top: -0.375rem;
    margin-inline-start: -0.375rem;
    border-radius: 50%;
    background: var(--brand-600);
    box-shadow: 0 0 0 2px var(--surface);
}

.range-row__value {
    color: var(--ink-900);
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: end;
}

.range-row__sd {
    color: var(--ink-500);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.histogram {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    align-items: end;
    height: 5.5rem;
    margin-block: 0.5rem 0;
    margin-inline: 7.875rem 8rem;
}

.histogram__bar {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}

.histogram__bar > span {
    min-height: 1px;
    border-start-start-radius: 4px;
    border-start-end-radius: 4px;
    background: var(--brand-400);
}

.histogram__bar small {
    position: absolute;
    inset-inline: 0;
    bottom: 100%;
    color: var(--ink-500);
    font-size: 0.625rem;
    text-align: center;
}

.histogram__bar > span:has(+ small:not(:empty)) {
    margin-top: 0.875rem;
}

.histogram__axis {
    display: flex;
    justify-content: space-between;
    margin-block: 0.25rem 0.875rem;
    margin-inline: 7.875rem 8rem;
    color: var(--ink-400);
    font-size: 0.6875rem;
}

/* reliability */
.alpha-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.625rem;
}

.alpha-tile {
    display: grid;
    gap: 0.125rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--ink-200);
    border-inline-start-width: 3px;
    border-radius: 10px;
}

.alpha-tile--success { border-inline-start-color: #10b981; }
.alpha-tile--info { border-inline-start-color: var(--brand-500); }
.alpha-tile--warning { border-inline-start-color: #f59e0b; }
.alpha-tile--danger { border-inline-start-color: #ef4444; }

.alpha-tile__name {
    color: var(--ink-600);
    font-size: 0.8125rem;
    font-weight: 600;
}

.alpha-tile__value {
    color: var(--ink-900);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
}

.alpha-tile__label {
    color: var(--ink-500);
    font-size: 0.75rem;
}

/* answer distribution: agreement on one side, disagreement on the other */
.likert-0 { background: #2a78d6; }
.likert-1 { background: #86b6ef; }
.likert-2 { background: #cbd5e1; }
.likert-3 { background: #f3a6a5; }
.likert-4 { background: #e34948; }

.likert-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 0.875rem;
    margin-inline-start: auto;
    color: var(--ink-500);
    font-size: 0.75rem;
}

.likert-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
}

.likert-legend i {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 2px;
}

.likert-bar {
    display: flex;
    gap: 2px;
    height: 0.75rem;
    overflow: hidden;
    border-radius: 4px;
}

.likert-bar > span {
    display: block;
    min-width: 2px;
}

.items-table td {
    vertical-align: middle;
}

.items-table__title {
    display: block;
    max-width: 30rem;
    color: var(--ink-900);
    font-weight: 500;
    line-height: 1.6;
    white-space: normal;
}

.items-table .badge {
    margin: 0.125rem 0;
}

/* correlation heatmap */
.heat-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
    color: var(--ink-500);
    font-size: 0.75rem;
}

.heat-legend i {
    flex: 0 1 5rem;
    height: 0.5rem;
    border-radius: 999px;
}

.heat-legend i:first-of-type {
    background: linear-gradient(to left, rgba(227, 73, 72, 0.92), rgba(227, 73, 72, 0.05));
}

.heat-legend i:last-of-type {
    background: linear-gradient(to left, rgba(42, 120, 214, 0.05), rgba(42, 120, 214, 0.92));
}

.heatmap {
    display: grid;
    grid-template-columns: 6.5rem repeat(var(--cols), minmax(2.5rem, 1fr));
    gap: 2px;
    overflow-x: auto;
    font-variant-numeric: tabular-nums;
}

.heatmap__col {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 5.5rem;
    padding-bottom: 0.25rem;
}

.heatmap__col > span {
    color: var(--ink-600);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.heatmap__row {
    display: flex;
    align-items: center;
    overflow: hidden;
    color: var(--ink-600);
    font-size: 0.75rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.heatmap__cell {
    display: grid;
    place-items: center;
    aspect-ratio: 1.25;
    border-radius: 4px;
    color: var(--ink-800);
    font-size: 0.75rem;
    font-weight: 600;
}

.heatmap__cell.is-dark {
    color: #fff;
}

.pair-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pair-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 9px;
    background: var(--ink-50);
}

.pair-list__names {
    color: var(--ink-800);
    font-size: 0.875rem;
    font-weight: 600;
}

.pair-list__names .bx {
    margin: 0 0.25rem;
    color: var(--ink-400);
    vertical-align: -0.125em;
}

.pair-list__r {
    color: var(--brand-700);
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* segments */
.segment-table .cell-high {
    color: var(--brand-700);
    font-weight: 700;
}

.segment-table .cell-low {
    color: var(--ink-400);
}

.segment-table tr.is-significant > td:first-child {
    box-shadow: inset -3px 0 0 var(--brand-500);
}

/* number of groups: silhouette per k */
.kbars {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0.5rem;
    align-items: end;
    height: 11rem;
}

.kbars__col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    height: 100%;
}

.kbars__col > span {
    width: min(100%, 1.5rem);
    border-start-start-radius: 4px;
    border-start-end-radius: 4px;
    background: var(--ink-300);
}

.kbars__col.is-best > span {
    background: var(--brand-600);
}

.kbars__col small {
    color: var(--ink-500);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}

.kbars__col.is-best small {
    color: var(--brand-700);
    font-weight: 700;
}

.kbars__col b {
    padding-top: 0.25rem;
    color: var(--ink-700);
    font-size: 0.8125rem;
}

.kbars__axis {
    margin: 0.25rem 0 0;
    color: var(--ink-400);
    font-size: 0.75rem;
    text-align: center;
}

.profile-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 0.875rem;
}

.profile-card {
    display: grid;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--ink-200);
    border-radius: 12px;
}

.profile-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.profile-card__name {
    color: var(--ink-900);
    font-weight: 700;
}

.profile-card__size {
    color: var(--ink-500);
    font-size: 0.75rem;
}

.profile-card .meter-row {
    grid-template-columns: 5.5rem minmax(0, 1fr) 2.5rem;
    gap: 0.5rem;
}

.profile-card__low {
    margin: 0.125rem 0 0;
    color: var(--ink-500);
    font-size: 0.75rem;
}

/* survey picker */
.survey-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    gap: 0.875rem;
}

.survey-pick {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    color: inherit;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}

.survey-pick:hover {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-md);
    color: inherit;
    transform: translateY(-1px);
}

.survey-pick__icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    border-radius: 11px;
    background: var(--brand-50);
    color: var(--brand-600);
    font-size: 1.375rem;
}

.survey-pick__body {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
}

.survey-pick__name {
    overflow: hidden;
    color: var(--ink-900);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.survey-pick__meta {
    color: var(--ink-500);
    font-size: 0.8125rem;
}

.survey-pick__go {
    color: var(--ink-400);
    font-size: 1.25rem;
}

/* the assistant */
.assistant.offcanvas {
    width: min(64rem, 100vw);
}

.assistant__layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
}

.assistant__history {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    padding: 1rem;
    border-inline-end: 1px solid var(--ink-100);
    background: var(--ink-50);
}

.assistant__history ul {
    display: grid;
    align-content: start;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.assistant__conversation {
    display: grid;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ink-700);
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.assistant__conversation span {
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assistant__conversation small {
    color: var(--ink-400);
    font-size: 0.6875rem;
}

.assistant__conversation:hover,
li.is-active > .assistant__conversation {
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.assistant__main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.assistant__thread {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    padding: 1.5rem;
    overflow-y: auto;
}

.assistant__welcome {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    margin: auto;
    max-width: 34rem;
    text-align: center;
}

.assistant__welcome h3 {
    margin: 0.5rem 0 0;
    font-size: 1.25rem;
}

.assistant__welcome p {
    color: var(--ink-500);
}

.quick-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.5rem;
    width: 100%;
    margin: 0.5rem 0;
}

.quick-prompt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--ink-200);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-800);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.quick-prompt:hover {
    border-color: var(--brand-300);
    background: var(--brand-50);
}

.quick-prompt .bx {
    color: var(--brand-600);
    font-size: 1.125rem;
}

.msg {
    display: grid;
    gap: 0.25rem;
    max-width: 92%;
}

.msg--user {
    align-self: flex-start;
}

.msg--assistant {
    align-self: flex-end;
    width: 92%;
}

.msg__body {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.9375rem;
    line-height: 1.85;
}

.msg--user .msg__body {
    border-start-start-radius: 4px;
    background: var(--brand-600);
    color: #fff;
    white-space: pre-wrap;
}

.msg--assistant .msg__body {
    border: 1px solid var(--ink-200);
    border-start-end-radius: 4px;
    background: var(--surface);
    color: var(--ink-800);
}

.msg--assistant .msg__body > :last-child {
    margin-bottom: 0;
}

.msg--assistant .msg__body h3,
.msg--assistant .msg__body h4,
.msg--assistant .msg__body h5 {
    margin: 0.875rem 0 0.375rem;
    font-size: 1rem;
    font-weight: 700;
}

.msg--assistant .msg__body > :first-child {
    margin-top: 0;
}

.msg--assistant .msg__body ul,
.msg--assistant .msg__body ol {
    padding-inline-start: 1.25rem;
}

.msg--error .msg__body {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.msg__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 0.25rem;
    color: var(--ink-400);
    font-size: 0.6875rem;
}

.msg__copy {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-500);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.msg__copy:hover {
    color: var(--brand-700);
}

.typing {
    display: inline-flex;
    gap: 3px;
    margin-inline-end: 0.375rem;
    vertical-align: middle;
}

.typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-400);
    animation: typing 1s ease-in-out infinite;
}

.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.msg--thinking .msg__body {
    color: var(--ink-500);
    font-size: 0.875rem;
}

.assistant__composer {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin: 0 1.25rem;
    padding: 0.5rem;
    border: 1px solid var(--ink-300);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.assistant__composer:focus-within {
    border-color: var(--brand-500);
    box-shadow: var(--ring);
}

.assistant__composer textarea {
    flex: 1 1 auto;
    min-height: 2.5rem;
    max-height: 10rem;
    padding: 0.5rem 0.625rem;
    border: 0;
    outline: 0;
    resize: none;
    background: transparent;
    color: var(--ink-900);
    font: inherit;
    line-height: 1.6;
}

.btn-icon-send {
    width: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
    border-radius: 10px;
}

.btn-icon-send .bx {
    margin: 0 !important;
    transform: scaleX(-1);
}

.assistant__note {
    margin: 0.5rem 1.25rem 1rem;
    color: var(--ink-400);
    font-size: 0.6875rem;
    text-align: center;
}

.assistant .offcanvas-header .bx {
    vertical-align: -0.125em;
}

@media (max-width: 991.98px) {
    .assistant__layout {
        grid-template-columns: 1fr;
    }

    .assistant__history {
        display: none;
    }

    .range-axis {
        display: none;
    }

    .range-row > summary {
        grid-template-columns: 5.5rem minmax(0, 1fr) 2.75rem;
    }

    .range-row__sd {
        display: none;
    }

    .histogram,
    .histogram__axis {
        margin-inline: 0;
    }
}

@media print {
    .layout-menu,
    .layout-navbar,
    .content-footer,
    .no-print,
    .offcanvas,
    .toast-stack {
        display: none !important;
    }

    .layout-page,
    .layout-container {
        padding: 0 !important;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
    }

    .report-section {
        break-inside: avoid-page;
    }

    .items-table tbody tr[hidden] {
        display: table-row !important;
    }

    body {
        background: var(--surface);
    }
}

/* 4.19 App-wide details ------------------------------------------------------------ */

/* the loading bar */
.top-progress {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 3000;
    height: 3px;
    pointer-events: none;
    opacity: 0;
    transform-origin: right;
    transform: scaleX(0);
    background: linear-gradient(270deg, var(--brand-500), #8b5cf6);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.top-progress.is-active {
    opacity: 1;
    transform: scaleX(0.85);
    transition: transform 8s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 0.2s;
}

.top-progress.is-done {
    transform: scaleX(1);
    opacity: 0;
    transition: transform 0.2s ease-out, opacity 0.3s 0.15s;
}

/* page content arrives gently */
.content-wrapper > .container-xxl,
.content-wrapper > .container-fluid {
    /* "backwards", not "both": a transform left in place after the animation would
       pin fixed drawers and dialogs inside this container to the page */
    animation: page-in 0.32s var(--ease) backwards;
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
}

/* quick navigation */
.topbar-search {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 13rem;
    margin-inline-end: 0.5rem;
    padding: 0.4375rem 0.625rem;
    border: 1px solid var(--ink-200);
    border-radius: 10px;
    background: var(--ink-50);
    color: var(--ink-500);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.topbar-search:hover {
    border-color: var(--ink-300);
    background: var(--surface);
}

.topbar-search kbd,
.palette kbd {
    margin-inline-start: auto;
    padding: 0.0625rem 0.375rem;
    border: 1px solid var(--ink-200);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--surface);
    color: var(--ink-500);
    font-family: inherit;
    font-size: 0.6875rem;
    direction: ltr;
}

.palette {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: grid;
    justify-items: center;
    align-items: start;
    padding: 12vh 1rem 1rem;
}

.palette__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    animation: fade-in 0.15s ease-out;
}

.palette__panel {
    position: relative;
    width: min(34rem, 100%);
    overflow: hidden;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: palette-in 0.18s var(--ease);
}

.palette__search {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--ink-100);
    color: var(--ink-400);
    font-size: 1.25rem;
}

.palette__search input::-webkit-search-cancel-button {
    display: none;
}

.palette__search input {
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    color: var(--ink-900);
    font: inherit;
    font-size: 1rem;
}

.palette__list {
    max-height: 22rem;
    margin: 0;
    padding: 0.375rem;
    overflow-y: auto;
    list-style: none;
}

.palette__list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 9px;
    cursor: pointer;
}

.palette__list li > i {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin: 0 !important;
    border-radius: 8px;
    background: var(--ink-100);
    color: var(--ink-600);
    font-size: 1.0625rem;
}

.palette__list li span {
    display: grid;
}

.palette__list li b {
    color: var(--ink-900);
    font-size: 0.875rem;
    font-weight: 600;
}

.palette__list li small {
    color: var(--ink-500);
    font-size: 0.75rem;
}

.palette__list li.is-active {
    background: var(--brand-50);
}

.palette__list li.is-active > i {
    background: var(--brand-600);
    color: #fff;
}

.palette__empty {
    justify-content: center;
    color: var(--ink-500);
    cursor: default !important;
}

@keyframes fade-in {
    from { opacity: 0; }
}

@keyframes palette-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
}

@media (max-width: 991.98px) {
    .topbar-search {
        min-width: 0;
        padding: 0.5rem;
        border: 0;
        background: none;
        font-size: 1.25rem;
    }

    .topbar-search span,
    .topbar-search kbd {
        display: none;
    }
}

/* 6. Sign-in and registration ---------------------------------------------- */
.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    min-height: 100vh;
    background: var(--surface);
}

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 3rem;
    overflow: hidden;
    background:
        radial-gradient(38rem 26rem at 12% 8%, rgba(99, 102, 241, 0.42), transparent 62%),
        radial-gradient(34rem 26rem at 88% 96%, rgba(56, 189, 248, 0.2), transparent 60%),
        linear-gradient(160deg, var(--ink-900), var(--ink-950));
    color: #fff;
}

.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 78%);
    pointer-events: none;
}

.auth-aside > * {
    position: relative;
    z-index: 1;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
}

.auth-brand:hover {
    color: #fff;
}

.auth-aside__title {
    max-width: 30rem;
    margin: 0 0 1rem;
    color: #fff;
    font-size: 2.125rem;
    font-weight: 700;
    line-height: 1.4;
}

.auth-aside__lead {
    max-width: 30rem;
    margin: 0;
    color: var(--ink-300);
    font-size: 1.0625rem;
    line-height: 1.8;
}

.auth-points {
    display: grid;
    gap: 0.875rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink-200);
    font-size: 0.9375rem;
}

.auth-points i {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.09);
    color: var(--brand-200);
    font-size: 1.125rem;
}

.auth-aside__foot {
    color: var(--ink-400);
    font-size: 0.8125rem;
}

.auth-main {
    position: relative;
    display: grid;
    place-items: center;
    padding: 2.5rem 1.5rem;
    background: var(--surface);
}

.auth-card {
    width: 100%;
    max-width: 26.5rem;
}

.auth-card--wide {
    max-width: 34rem;
}

.auth-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.875rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 0.75rem;
    font-weight: 600;
}

.auth-card__title {
    margin: 0 0 0.375rem;
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--ink-900);
}

.auth-card__lead {
    margin: 0 0 1.75rem;
    color: var(--ink-500);
}

.auth-card .btn-primary {
    width: 100%;
    min-height: 2.875rem;
    font-size: 0.9375rem;
}

.auth-card__switch {
    margin: 1.5rem 0 0;
    color: var(--ink-500);
    font-size: 0.875rem;
    text-align: center;
}

.auth-card__switch a {
    font-weight: 600;
}

.auth-mobile-brand {
    display: none;
    margin-bottom: 2rem;
    color: var(--ink-900);
}

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .auth-mobile-brand {
        display: flex;
    }
}

/* 6.1 Reading pages (privacy) and error pages -------------------------------- */
.content-wrapper > .prose-page {
    max-width: 52rem;
}

.prose-card {
    padding: 2.25rem 2.5rem;
    color: var(--ink-700);
    font-size: 1rem;
    line-height: 2;
}

.prose-card__header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--ink-100);
}

.prose-card__header h1 {
    margin: 0;
    font-size: 1.625rem;
    font-weight: 700;
}

.prose-card__header p {
    margin: 0.25rem 0 0;
    color: var(--ink-500);
    font-size: 0.875rem;
}

.prose-card h2 {
    margin: 1.75rem 0 0.375rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.prose-card p {
    margin: 0 0 0.5rem;
}

.error-page {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.5rem;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    background: var(--canvas);
    text-align: center;
}

.error-page__brand {
    margin-bottom: 2rem;
    color: var(--ink-900);
}

.error-page__brand:hover {
    color: var(--ink-900);
}

.error-page__code {
    margin: 0;
    color: var(--brand-600);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.error-page__title {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
}

.error-page__lead {
    max-width: 30rem;
    margin: 0.25rem 0 0;
    color: var(--ink-500);
    font-size: 1rem;
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 575.98px) {
    .prose-card {
        padding: 1.5rem 1.25rem;
    }
}

/* 7. Responsive shell ------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .layout-navbar.navbar,
    .layout-navbar.navbar.navbar-detached {
        padding: 0 1rem !important;
    }

    .content-wrapper > .container-xxl,
    .content-wrapper > .container-fluid {
        padding-inline: 1rem;
    }

    .topbar-user__name,
    .topbar-user__role {
        display: none;
    }

    .topbar-user {
        padding: 0.25rem;
    }
}

@media (max-width: 767.98px) {
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_paginate {
        margin-top: 0.625rem;
        text-align: start !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
    }

    .pagination {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .page-header__title {
        font-size: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================================================
   8. Dark theme
   --------------------------------------------------------------------------
   <html data-theme="dark"> (set before paint by head-boot.blade.php). The ink
   scale is inverted, so every rule written against the tokens works in both
   themes: --ink-900 is always "strongest text", --ink-50 "subtle fill".
   Surfaces that are dark in both themes (side menu, sign-in panel, toasts)
   keep the light-theme scale locally.
   ========================================================================== */
:root[data-theme="dark"] {
    color-scheme: dark;

    --ink-950: #f8fafc;
    --ink-900: #eef2f7;
    --ink-800: #dde3ec;
    --ink-700: #c3ccd9;
    --ink-600: #a2adbd;
    --ink-500: #8592a6;
    --ink-400: #667388;
    --ink-300: #3d4859;
    --ink-200: #2b3444;
    --ink-100: #1f2735;
    --ink-50: #182030;

    --canvas: #0c111b;
    --surface: #121927;
    --surface-raised: #172032;

    --brand-50: rgba(99, 102, 241, 0.14);
    --brand-100: rgba(99, 102, 241, 0.24);
    --brand-200: rgba(129, 140, 248, 0.42);
    --brand-300: #7b7fe8;
    --brand-400: #8b8ff0;
    --brand-500: #7c7ff2;
    --brand-600: #6366f1;
    --brand-700: #a5b4fc;
    --brand-800: #c7d2fe;

    --success: #34d399;
    --success-soft: rgba(16, 185, 129, 0.13);
    --success-line: rgba(52, 211, 153, 0.35);
    --warning: #fbbf24;
    --warning-soft: rgba(245, 158, 11, 0.13);
    --warning-line: rgba(251, 191, 36, 0.35);
    --danger: #f87171;
    --danger-soft: rgba(239, 68, 68, 0.13);
    --danger-line: rgba(248, 113, 113, 0.35);
    --info: #38bdf8;
    --info-soft: rgba(14, 165, 233, 0.13);
    --info-line: rgba(56, 189, 248, 0.35);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 14px 30px -12px rgba(0, 0, 0, 0.7), 0 4px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.85);
    --ring: 0 0 0 3px rgba(129, 140, 248, 0.35);

    --bs-body-color: var(--ink-700);
    --bs-body-bg: var(--canvas);
    --bs-border-color: var(--ink-200);
    --bs-heading-color: var(--ink-900);
}

/* surfaces that are dark in both themes keep the light-theme scale */
.layout-menu.bg-menu-theme,
.auth-aside,
.app-toast {
    --ink-950: #0b1120;
    --ink-900: #0f172a;
    --ink-800: #1e293b;
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748b;
    --ink-400: #94a3b8;
    --ink-300: #cbd5e1;
    --ink-200: #e2e8f0;
    --ink-100: #f1f5f9;
    --ink-50: #f8fafc;
    --brand-200: #c7d2fe;
    --brand-400: #818cf8;
}

[data-theme="dark"] .layout-menu.bg-menu-theme {
    background: linear-gradient(180deg, #0a0f1a 0%, #070b13 100%) !important;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] body,
[data-theme="dark"] .layout-wrapper,
[data-theme="dark"] .layout-container,
[data-theme="dark"] .layout-page,
[data-theme="dark"] .content-wrapper {
    background: var(--canvas);
    color: var(--ink-700);
}

/* template components the design system did not need to touch in light mode */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .offcanvas,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .popover,
[data-theme="dark"] .list-group-item,
[data-theme="dark"] .swal2-popup,
[data-theme="dark"] .apexcharts-tooltip,
[data-theme="dark"] .picker__menu,
[data-theme="dark"] .palette__panel {
    background: var(--surface-raised) !important;
    color: var(--ink-800);
    border-color: var(--ink-200);
}

[data-theme="dark"] .swal2-title,
[data-theme="dark"] .swal2-html-container {
    color: var(--ink-800) !important;
}

[data-theme="dark"] .swal2-icon.swal2-success [class^="swal2-success-circular-line"],
[data-theme="dark"] .swal2-icon.swal2-success .swal2-success-fix {
    background: transparent !important;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1) brightness(1.6);
}

[data-theme="dark"] .text-dark,
[data-theme="dark"] .text-body,
[data-theme="dark"] .text-heading {
    color: var(--ink-800) !important;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-lighter {
    background-color: var(--surface) !important;
}

[data-theme="dark"] .border,
[data-theme="dark"] hr {
    border-color: var(--ink-200) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text {
    background-color: var(--ink-50);
    border-color: var(--ink-300);
    color: var(--ink-900);
}

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled {
    background-color: var(--ink-100);
    color: var(--ink-500);
}

[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a2adbd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

[data-theme="dark"] .form-check-input {
    background-color: var(--ink-50);
    border-color: var(--ink-400);
}

[data-theme="dark"] .form-check-input:checked {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
}

[data-theme="dark"] .table > :not(caption) > * > * {
    color: var(--ink-700);
}

[data-theme="dark"] .table thead th {
    background: var(--ink-50);
}

[data-theme="dark"] .card-footer,
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .offcanvas-footer {
    background: color-mix(in srgb, var(--surface) 70%, var(--canvas));
}

[data-theme="dark"] .layout-navbar.navbar {
    border-bottom-color: var(--ink-200);
}

[data-theme="dark"] .avatar-initials {
    background: var(--brand-100);
    color: var(--brand-800);
}

[data-theme="dark"] .btn-primary:disabled,
[data-theme="dark"] .btn-primary.disabled {
    background: var(--ink-200) !important;
    border-color: var(--ink-200) !important;
    color: var(--ink-500) !important;
}

/* answer distribution and heat map keep readable contrast on the dark surface */
[data-theme="dark"] .likert-2 { background: #4b5566; }
[data-theme="dark"] .heatmap__cell { color: var(--ink-800); }

[data-theme="dark"] .apexcharts-gridline,
[data-theme="dark"] .apexcharts-xaxis line,
[data-theme="dark"] .apexcharts-yaxis line {
    stroke: var(--ink-200);
}

[data-theme="dark"] .apexcharts-text,
[data-theme="dark"] .apexcharts-legend-text {
    fill: var(--ink-600) !important;
    color: var(--ink-600) !important;
}

[data-theme="dark"] .apexcharts-radar-series polygon,
[data-theme="dark"] .apexcharts-radar-series line {
    stroke: var(--ink-200) !important;
}

[data-theme="dark"] img.illustration,
[data-theme="dark"] .app-brand-logo img {
    filter: none;
}

/* the switch from one theme to the other is a soft cross-fade, not a flash */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease !important;
}

/* ==========================================================================
   9. Left-to-right (English)
   --------------------------------------------------------------------------
   Layout rules use logical properties, so most of the interface mirrors by
   itself; these are the few things drawn with a physical direction.
   ========================================================================== */
:root[lang="en"] {
    --font: "IBM Plex Sans", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
}

[dir="ltr"] .form-select {
    background-position: right 0.75rem center;
}

[dir="ltr"] .dataTables_wrapper .dataTables_filter input,
[dir="ltr"] .dt-container .dt-search input {
    background-position: left 0.625rem center;
}

[dir="ltr"] .top-progress {
    transform-origin: left;
    background: linear-gradient(90deg, var(--brand-500), #8b5cf6);
}

[dir="ltr"] .toast-stack {
    transform: translateX(-50%);
}

[dir="ltr"] .heat-legend i:first-of-type {
    background: linear-gradient(to right, rgba(227, 73, 72, 0.92), rgba(227, 73, 72, 0.05));
}

[dir="ltr"] .heat-legend i:last-of-type {
    background: linear-gradient(to right, rgba(42, 120, 214, 0.05), rgba(42, 120, 214, 0.92));
}

[dir="ltr"] .segment-table tr.is-significant > td:first-child {
    box-shadow: inset 3px 0 0 var(--brand-500);
}

[dir="ltr"] .survey-pick__go,
[dir="ltr"] .page-back .bx,
[dir="ltr"] .btn-icon-send .bx {
    transform: scaleX(-1);
}

[dir="ltr"] .btn-icon-send .bx {
    transform: none;
}

[dir="ltr"] .apexcharts-tooltip-marker {
    margin-inline-end: 0.5rem !important;
}


/* language and theme switches */
.prefs {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.prefs__lang {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.prefs__menu {
    min-width: 11rem;
}

.prefs .topbar-icon {
    border: 0;
    background: none;
    font-size: 1.25rem;
}

.theme-icon--dark,
[data-theme="dark"] .theme-icon--light {
    display: none;
}

[data-theme="dark"] .theme-icon--dark {
    display: inline;
}

.prefs--floating {
    position: absolute;
    inset-block-start: 1rem;
    inset-inline-end: 1rem;
    z-index: 5;
}

.app-toast__text {
    flex: 1 1 auto;
}

.app-toast__action {
    flex: 0 0 auto;
    margin: -0.25rem 0;
    padding: 0.25rem 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.app-toast__action:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   10. Shared CRUD pages (resources/views/crud, public/assets/js/crud.js)
   ========================================================================== */
.crud__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ink-100);
}

.crud__search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 18rem;
    max-width: 26rem;
    margin: 0;
}

.crud__search > .bx {
    position: absolute;
    inset-inline-start: 0.75rem;
    color: var(--ink-400);
    font-size: 1.125rem;
    pointer-events: none;
}

.crud__search input {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.4375rem 2.25rem;
    border: 1px solid var(--ink-300);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-900);
    font: inherit;
    font-size: 0.875rem;
    outline: 0;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.crud__search input:focus {
    border-color: var(--brand-500);
    box-shadow: var(--ring);
}

.crud__search input::-webkit-search-cancel-button {
    cursor: pointer;
}

.crud__search .kbd-hint {
    position: absolute;
    inset-inline-end: 0.625rem;
}

.crud__search input:focus ~ .kbd-hint,
.crud__search input:not(:placeholder-shown) ~ .kbd-hint {
    display: none;
}

.kbd-hint {
    padding: 0 0.375rem;
    border: 1px solid var(--ink-200);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--ink-50);
    color: var(--ink-500);
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.5;
}

.btn-primary .kbd-hint {
    margin-inline-start: 0.5rem;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
}

.crud__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crud__filters .form-select {
    width: auto;
    min-width: 11rem;
    max-width: 16rem;
}

.crud__count {
    margin-inline-start: auto;
    color: var(--ink-500);
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.crud__bulk {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid var(--brand-100);
    background: var(--brand-50);
    color: var(--brand-800);
    font-size: 0.875rem;
    font-weight: 600;
    animation: fade-in 0.15s ease-out;
}

.crud__bulk .btn-outline-danger {
    margin-inline-start: auto;
}

.crud__table-wrap {
    overflow-x: auto;
}

.crud__table {
    margin: 0;
}

.crud__table.is-refreshing tbody {
    opacity: 0.55;
    transition: opacity 0.15s;
}

.crud__table > thead > tr > th {
    white-space: nowrap;
}

.crud__table > thead > tr > th:first-child,
.crud__table > tbody > tr > td:first-child {
    padding-inline-start: 1.25rem;
}

.crud__table > thead > tr > th:last-child,
.crud__table > tbody > tr > td:last-child {
    padding-inline-end: 1.25rem;
}

.crud__check {
    width: 2.75rem;
}

.crud__check .form-check-input {
    margin: 0;
    cursor: pointer;
}

.crud__sort {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.crud__sort .bx {
    color: var(--ink-400);
    font-size: 0.9375rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.crud__sort:hover .bx,
.crud__sort.is-active .bx,
.crud__sort:focus-visible .bx {
    opacity: 1;
}

.crud__sort.is-active {
    color: var(--ink-900);
}

.crud__sort.is-active .bx {
    color: var(--brand-600);
}

.crud__table tbody tr.is-clickable {
    cursor: pointer;
}

.crud__table tbody tr.is-selected > td {
    background: var(--brand-50) !important;
}

.crud__table tbody tr.is-new > td {
    animation: row-flash 1.6s ease-out;
}

.crud__table tbody tr.is-removing {
    opacity: 0.4;
    transition: opacity 0.2s;
}

@keyframes row-flash {
    0%, 30% { background: var(--brand-100); }
}

.crud__primary {
    min-width: 12rem;
}

.crud__primary-text {
    display: block;
    color: var(--ink-900);
    font-weight: 600;
}

.crud__meta {
    display: block;
    color: var(--ink-500);
    font-size: 0.78125rem;
}

.crud__date {
    white-space: nowrap;
}

.crud__tag {
    display: inline-block;
    margin: 0.125rem;
    margin-inline-start: 0;
    padding: 0.0625rem 0.5rem;
    border-radius: 999px;
    background: var(--ink-100);
    color: var(--ink-700);
    font-size: 0.75rem;
    font-weight: 600;
}

.crud__mono {
    padding: 0.125rem 0.375rem;
    border-radius: 5px;
    background: var(--ink-100);
    color: var(--ink-800);
    font-size: 0.8125rem;
    direction: ltr;
    unicode-bidi: isolate;
}

.crud__actions {
    width: 1%;
    white-space: nowrap;
}

.crud__actions .row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
}

.crud__actions .btn-icon {
    border-color: transparent;
    background: transparent;
}

.crud__table tbody tr:hover .crud__actions .btn-icon,
.crud__actions .btn-icon:focus-visible,
.crud__actions .show > .btn-icon {
    border-color: var(--ink-200);
    background: var(--surface);
}

.crud__empty-row > td,
.crud__empty-row:hover > td {
    background: transparent !important;
    cursor: default;
}

.crud__skeleton .skeleton {
    height: 0.875rem;
}

.crud__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--ink-100);
}

.crud__pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.crud__range {
    color: var(--ink-500);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.crud__pages .pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.crud__pages .page-link {
    cursor: pointer;
}

.crud__pages .page-link:disabled {
    cursor: default;
    opacity: 0.4;
}

.page-gap {
    padding: 0 0.25rem;
    color: var(--ink-400);
}

/* the side panel */
.offcanvas.crud-panel {
    width: min(34rem, 100vw);
}

.crud-panel .offcanvas-header {
    align-items: flex-start;
}

.crud-panel .offcanvas-footer {
    align-items: center;
}

.crud-panel__hint {
    margin-inline-end: auto;
    color: var(--ink-400);
    font-size: 0.75rem;
}

.crud-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1rem;
}

.crud-field {
    grid-column: 1 / -1;
    min-width: 0;
}

.crud-field--half {
    grid-column: span 1;
}

.crud-field[hidden] {
    display: none;
}

.crud-field .invalid-feedback:empty {
    display: none;
}

.crud-field .is-invalid ~ .invalid-feedback,
.crud-field .invalid-feedback:not(:empty),
.repeater__cell .invalid-feedback:not(:empty) {
    display: block;
}

.crud-field .segmented.is-invalid,
.crud-field .repeater.is-invalid {
    border-color: var(--danger);
}

.crud-form__section {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ink-100);
}

.crud-form__section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.crud-form__section h6 {
    margin: 0;
    color: var(--ink-900);
    font-size: 0.9375rem;
    font-weight: 700;
}

.crud-form__section p {
    margin: 0.125rem 0 0;
    color: var(--ink-500);
    font-size: 0.8125rem;
}

.crud-form__notice,
.crud-form__errors {
    margin-bottom: 1.25rem;
}

.crud-form__loading {
    display: grid;
    gap: 1.25rem;
}

.crud-form__loading .skeleton {
    height: 2.625rem;
    border-radius: 8px;
}

.crud-switch {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0.25rem 0 0;
    padding: 0;
    cursor: pointer;
}

.crud-switch .form-check-input {
    float: none;
    width: 2.5rem;
    height: 1.375rem;
    margin: 0;
}

.crud-switch .form-check-label {
    color: var(--ink-800);
    font-weight: 600;
}

/* repeater: ordered rows of sub-fields */
.repeater {
    display: grid;
    gap: 0.5rem;
}

.repeater__rows {
    display: grid;
    gap: 0.5rem;
}

.repeater__row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--ink-200);
    border-radius: 10px;
    background: var(--ink-50);
}

.repeater__index {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 2.625rem;
    flex: 0 0 auto;
    color: var(--ink-500);
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.repeater__cell {
    flex: 1 1 auto;
    min-width: 0;
}

.repeater__tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.25rem;
    height: 2.625rem;
}

.repeater__tools .btn-icon {
    --btn-h: 1.875rem;
    width: 1.875rem;
    min-width: 1.875rem;
    height: 1.875rem;
}

.repeater__add {
    justify-self: start;
}

.swal2-styled.swal2-confirm.swal2-confirm--danger {
    background: var(--danger) !important;
}

@media (max-width: 575.98px) {
    .crud-form__grid {
        grid-template-columns: 1fr;
    }

    .crud-field--half {
        grid-column: 1 / -1;
    }

    .crud__count {
        width: 100%;
        margin: 0;
    }

    .crud-panel__hint,
    .kbd-hint {
        display: none;
    }
}

/* Bootstrap draws a 2px current-colour line above every table body */
.table > :not(:first-child) {
    border-top: 0;
}

[data-theme="dark"] .callout--warning {
    color: var(--warning);
}

.offcanvas:focus,
.offcanvas:focus-visible {
    outline: none;
}

.swal2-styled.swal2-confirm.swal2-confirm--danger {
    background: #dc2626 !important;
}

/* Sidebar group arrow. The template draws it with borders and physical
   left/right offsets, which pointed the wrong way in one direction and sat
   on the very edge. This one is a chevron pointing towards the reading
   direction when the group is closed (› in English, ‹ in Arabic) and turning
   down when it opens. */
.layout-menu .menu-inner > .menu-item > .menu-link.menu-toggle {
    position: relative;
    padding-inline-end: 2.25rem !important;
}

.layout-menu .menu-toggle::after {
    content: "" !important;
    position: absolute;
    top: 50% !important;
    left: auto !important;
    right: auto !important;
    inset-inline-end: 0.75rem !important;
    width: 1rem !important;
    height: 1rem !important;
    border: 0 !important;
    background: var(--ink-500);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    transform: translateY(-50%) rotate(0deg) !important;
    transition: transform 0.2s var(--ease), background-color 0.15s var(--ease) !important;
}

[dir="rtl"] .layout-menu .menu-toggle::after {
    transform: translateY(-50%) rotate(180deg) !important;
}

.layout-menu .menu-item.open:not(.menu-item-closing) > .menu-toggle::after {
    transform: translateY(-50%) rotate(90deg) !important;
}

.layout-menu .menu-link:hover.menu-toggle::after,
.layout-menu .menu-item.open > .menu-toggle::after {
    background: var(--ink-300);
}

/* the open group's sub-items hang from a thin guide line */
.layout-menu .menu-inner > .menu-item.open > .menu-sub {
    position: relative;
}

.layout-menu .menu-inner > .menu-item.open > .menu-sub::before {
    content: "";
    position: absolute;
    top: 0.375rem;
    bottom: 0.375rem;
    inset-inline-start: 1.4375rem;
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* The template fixes every menu row at the menu's full width (16.25rem); with
   the inner padding that made rows overflow by 24px, pushing the arrows onto
   the sidebar's edge. Rows take the width they are given instead. */
.layout-menu .menu-inner > .menu-item,
.layout-menu .menu-inner > .menu-header {
    width: auto !important;
    align-self: stretch;
}

[data-theme="dark"] .app-toast {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1e293b;
}

.prefs__menu .dropdown-item.active::after {
    content: "";
    width: 0.875rem;
    height: 0.875rem;
    margin-inline-start: auto;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
}

.prefs__menu .dropdown-item {
    display: flex;
    align-items: center;
}

.callout--success {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: var(--success);
}

.repeater.is-locked .repeater__row {
    background: transparent;
    border-style: dashed;
}

.callout--info {
    border-color: var(--info-line);
    background: var(--info-soft);
    color: var(--info);
}

.callout--danger {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

/* A long page title must give way before the top bar's buttons do (narrow screens). */
.layout-navbar .navbar-nav-right {
    min-width: 0;
}

.app-topbar__title {
    flex: 0 1 auto;
    min-width: 0;
}

/* visually hidden cells inside a scrolling table must not widen the page */
.table-responsive {
    position: relative;
}

[dir="ltr"] .order-steps li + li::before {
    content: "→";
}

[data-theme="dark"] .status-dot--ok::before { box-shadow: 0 0 0 3px var(--success-soft); }
[data-theme="dark"] .status-dot--bad::before { box-shadow: 0 0 0 3px var(--danger-soft); }
[data-theme="dark"] .status-dot::before { box-shadow: 0 0 0 3px var(--ink-100); }

/* ==========================================================================
   11. Notifications panel (top bar, public/assets/js/notifications.js)
   ========================================================================== */
.notif-panel.dropdown-menu {
    width: min(24rem, calc(100vw - 1.5rem));
    padding: 0;
    overflow: hidden;
}

.notif-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--ink-100);
}

.notif-panel__title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-900);
    font-size: 0.9375rem;
    font-weight: 700;
}

.notif-panel__count {
    min-width: 1.375rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.375rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.notif-panel__read-all {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--brand-700);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.notif-panel__read-all:hover {
    background: var(--brand-50);
}

.notif-panel__read-all .bx {
    font-size: 1.0625rem;
}

.notif-list {
    max-height: min(26rem, 70vh);
    margin: 0;
    padding: 0.375rem;
    overflow-y: auto;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: var(--ink-200) transparent;
}

.notif {
    position: relative;
    display: flex;
    align-items: stretch;
    border-radius: 10px;
    transition: background-color 0.15s var(--ease), opacity 0.18s, transform 0.18s;
}

.notif + .notif {
    margin-top: 0.125rem;
}

.notif:hover {
    background: var(--ink-50);
}

.notif.is-leaving {
    opacity: 0;
    transform: translateX(0.75rem);
}

[dir="rtl"] .notif.is-leaving {
    transform: translateX(-0.75rem);
}

.notif__link {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.625rem 0.625rem;
    padding-inline-end: 2.5rem;
    border-radius: 10px;
    color: inherit;
}

.notif__link:hover {
    color: inherit;
}

.notif__link:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: -2px;
}

.notif__icon {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border-radius: 10px;
    font-size: 1.125rem;
}

.notif__icon--brand { background: var(--brand-50); color: var(--brand-600); }
.notif__icon--success { background: var(--success-soft); color: var(--success); }
.notif__icon--warning { background: var(--warning-soft); color: var(--warning); }

.notif__body {
    display: grid;
    gap: 0.0625rem;
    min-width: 0;
}

.notif__title {
    color: var(--ink-900);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
}

.notif__text {
    overflow: hidden;
    color: var(--ink-600);
    font-size: 0.8125rem;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif__time {
    margin-top: 0.125rem;
    color: var(--ink-400);
    font-size: 0.75rem;
}

/* unread dot, replaced by the "mark as read" button on hover */
.notif__dot {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--brand-600);
    transition: opacity 0.15s;
}

.notif__done {
    position: absolute;
    top: 0.5rem;
    inset-inline-end: 0.5rem;
    display: grid;
    place-items: center;
    width: 1.875rem;
    height: 1.875rem;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-600);
    font-size: 1.125rem;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}

.notif:hover .notif__done,
.notif__done:focus-visible {
    opacity: 1;
}

.notif:hover .notif__dot {
    opacity: 0;
}

.notif__done:hover {
    border-color: var(--success-line);
    color: var(--success);
}

/* touch screens have no hover: keep the button visible */
@media (hover: none) {
    .notif__done { opacity: 1; }
    .notif__dot { display: none; }
}

.notif-empty {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 2rem 1rem 2.25rem;
    text-align: center;
}

.notif-empty__icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.375rem;
    border-radius: 50%;
    background: var(--ink-100);
    color: var(--ink-400);
    font-size: 1.5rem;
}

.notif-empty__title {
    color: var(--ink-800);
    font-size: 0.9375rem;
    font-weight: 600;
}

.notif-empty__text {
    color: var(--ink-500);
    font-size: 0.8125rem;
}

.notif-skeleton {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem 0.625rem;
}

.notif-skeleton .skeleton:first-child { width: 70%; }
.notif-skeleton .skeleton:last-child { width: 45%; height: 0.625rem; }

/* 12. Notifications page ------------------------------------------------------- */
/* panel footer: the way to the full page */
.notif-panel__all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--ink-100);
    color: var(--brand-600);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background-color 0.15s var(--ease);
}

.notif-panel__all:hover {
    background: var(--ink-50);
    color: var(--brand-700);
}

.notif-panel__all .bx {
    font-size: 1.125rem;
}

[dir="ltr"] .notif-panel__all .bx {
    transform: scaleX(-1);
}

.notif-page__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* the segmented control, as links */
.segmented__item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 7px;
    color: var(--ink-600);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.segmented__item:hover {
    color: var(--ink-900);
}

.segmented__item.is-active {
    background: var(--surface);
    color: var(--ink-900);
    box-shadow: var(--shadow-sm);
}

.segmented__count,
.notif-type__count {
    min-width: 1.375rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--ink-100);
    color: var(--ink-600);
    font-size: 0.6875rem;
    line-height: 1.25rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.segmented__item.is-active .segmented__count {
    background: var(--brand-50);
    color: var(--brand-700);
}

.notif-page__types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.notif-type {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    border: 1px solid var(--ink-200);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-700);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.notif-type:hover {
    border-color: var(--ink-300);
    color: var(--ink-900);
}

.notif-type.is-active {
    border-color: var(--brand-600);
    background: var(--brand-600);
    color: #fff;
}

.notif-type.is-active .notif-type__count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.notif-day + .notif-day {
    border-top: 1px solid var(--ink-100);
}

.notif-day__label {
    margin: 0;
    padding: 1rem 1.25rem 0.25rem;
    color: var(--ink-500);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.notif-list--page {
    max-height: none;
    padding: 0.25rem 0.625rem 0.625rem;
    overflow: visible;
}

.notif-list--page .notif__link {
    padding: 0.75rem;
    padding-inline-end: 3rem;
}

.notif-list--page .notif__text {
    white-space: normal;
}

.notif-list--page .notif__dot {
    top: 1.125rem;
    inset-inline-end: 1.125rem;
}

.notif-list--page .notif__done {
    top: 0.625rem;
    inset-inline-end: 0.625rem;
}

/* one action at a time: ✓ on unread rows, "mark unread" on read ones */
.notif [data-action="unread"],
.notif.is-read [data-action="read"],
.notif.is-read .notif__dot {
    display: none;
}

.notif.is-read [data-action="unread"] {
    display: grid;
}

.notif.is-read .notif__title {
    color: var(--ink-700);
    font-weight: 500;
}

.notif.is-read .notif__icon {
    opacity: 0.7;
}

.notif-page__pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}

.notif-page__range {
    color: var(--ink-500);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.notif-page__pager nav .d-sm-flex > div:first-child {
    display: none !important;
}

.notif-page__pager .pagination {
    margin: 0;
}

/* 13. Sign-in code (auth/login-code.blade.php) ----------------------------------- */
.auth-code__icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    border-radius: 14px;
    background: var(--brand-50);
    color: var(--brand-600);
    font-size: 1.5rem;
}

.auth-code__email {
    color: var(--ink-900);
    font-weight: 600;
}

.auth-code__input.form-control {
    height: 3.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-align: center;
    text-indent: 0.5em; /* balances the trailing letter-spacing */
}

.auth-code__input.form-control::placeholder {
    color: var(--ink-300);
    letter-spacing: 0.5em;
}

.auth-code__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ink-100);
}

.auth-code__actions .btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-code__actions .btn-link:disabled {
    opacity: 0.55;
}

.auth-code__wait {
    font-variant-numeric: tabular-nums;
}

/* a dialog that asks a choice with long options (e.g. who a change applies to) */
.swal2-radio.qpick-apply {
    background: transparent;
    color: var(--ink-800);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0 1.5rem;
}

.swal2-radio.qpick-apply label {
    margin: 0;
    font-size: 0.9375rem;
    text-align: start;
}


/* A table row's "more" menu: never taller than the window, scrolls inside (crud.js). */
.dropdown-menu.row-menu {
    max-height: min(60vh, 26rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Brand: عدسة / Adasa (resources/views/_partials/brand/*, App\Support\Brand) ---------------- */
.brand-mark {
    flex: 0 0 auto;
    display: block;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    color: inherit;
}

.brand-lockup__text {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.brand-lockup__tagline {
    font-size: 0.72em;
    font-weight: 500;
    opacity: 0.72;
    white-space: nowrap;
}

.brand-word {
    position: relative;
    display: inline-block;
    width: max-content;
    font-weight: 700;
    line-height: 1;
    padding-top: 0.12em;
}

.brand-word--ar {
    font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif;
}

.brand-word--en {
    font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif;
    letter-spacing: -0.02em;
}

/* the two dots of the ة: indigo and teal circles in place of the letter's own dots (positions in em) */
.brand-word--ar::before,
.brand-word--ar::after {
    content: "";
    position: absolute;
    top: 0.21em;
    width: 0.13em;
    height: 0.13em;
    border-radius: 50%;
}

/* exactly where the font draws the ة's own dots */
.brand-word--ar::before {
    left: 0.205em;
    background: #4f46e5;
}

.brand-word--ar::after {
    left: 0.375em;
    background: #14b8a6;
}

/* the dark sidebar and dark theme: the indigo dot needs more light to show */
.layout-menu .brand-word--ar::before,
[data-theme="dark"] .brand-word--ar::before,
.auth-aside .brand-word--ar::before {
    background: #818cf8;
}

.layout-menu .app-brand-link {
    color: #fff;
}

.layout-menu .app-brand-link .brand-word {
    font-size: 1.25rem;
}

.auth-brand .brand-word {
    font-size: 1.5rem;
}

.auth-brand .brand-lockup__tagline {
    font-size: 0.875rem;
}
