/* Shell, navigation and product components (rz-*) for the Resaala company dashboard. */

.admin-body {
    margin: 0;
    overflow-x: hidden;
    background: var(--rz-canvas);
}

/* ---------- scrollbars ----------
   Thin and in the theme's colours (page, sidebar, tables, lists, menus) instead of the operating
   system's grey bar with arrow buttons. Chromium/Edge/Safari use the ::-webkit-scrollbar rules;
   Firefox uses the standard properties (scoped to Firefox: in Chrome 121+ they would switch the
   ::-webkit-scrollbar rules off). */
:root {
    --rz-scroll-thumb: color-mix(in srgb, var(--rz-line-strong) 45%, transparent);
    --rz-scroll-thumb-hover: color-mix(in srgb, var(--rz-line-strong) 80%, transparent);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    min-height: 40px;
    border: 3px solid transparent;
    border-radius: 999px;
    background-color: var(--rz-scroll-thumb);
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active {
    background-color: var(--rz-scroll-thumb-hover);
}

::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

@supports (-moz-appearance: none) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--rz-scroll-thumb) transparent;
    }
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- sidebar ---------- */
.admin-sidebar {
    width: var(--rz-sidebar-width);
    background: var(--rz-surface);
    border-inline-end: 1px solid var(--rz-line);
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 0 12px 16px;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--rz-topbar-height);
    flex: none;
    padding: 0 10px;
    margin: 0 -12px 8px;
    padding-inline: 22px;
    border-bottom: 1px solid var(--rz-line);
    text-decoration: none;
}

.brand-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: none;
}

.rz-mark {
    width: 100%;
    height: 100%;
    display: block;
}

.rz-mark-bubble { fill: var(--rz-brand); }
.rz-mark-bar { fill: var(--rz-on-brand); }

[dir="ltr"] .rz-mark {
    transform: scaleX(-1);
}

.brand-text {
    font-weight: 600;
    font-size: 18px;
    color: var(--rz-ink);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-group {
    font-size: 12px;
    font-weight: 500;
    color: var(--rz-muted);
    padding: 16px 10px 6px;
    margin-top: 6px;
    border-top: 1px solid var(--rz-line);
}

.sidebar-nav > .sidebar-link:first-child + .sidebar-group {
    margin-top: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: var(--rz-radius-m);
    color: var(--rz-text);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 150ms ease, color 150ms ease;
}

.sidebar-link i {
    font-size: 17px;
    color: var(--rz-muted);
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background: var(--rz-sunken);
    color: var(--rz-ink);
}

.sidebar-link.active {
    background: var(--rz-brand-tint);
    color: var(--rz-ink);
    font-weight: 500;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rz-brand) 30%, transparent);
}

.sidebar-link.active i {
    color: var(--rz-brand-text);
}

.sidebar-count {
    margin-inline-start: auto;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px 10px var(--rz-radius-tail) 10px;
    background: var(--rz-brand);
    color: var(--rz-on-brand);
    font-size: 12px;
    font-weight: 600;
    display: grid;
    place-items: center;
}

.sidebar-foot {
    margin-top: 16px;
    padding: 14px 10px 0;
    border-top: 1px solid var(--rz-line);
}

.sidebar-backdrop {
    display: none;
}

/* ---------- main + topbar ---------- */
.admin-main {
    margin-inline-start: var(--rz-sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    height: var(--rz-topbar-height);
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 32px;
    background: color-mix(in srgb, var(--rz-surface) 92%, transparent);
    border-bottom: 1px solid var(--rz-line);
    backdrop-filter: saturate(140%) blur(8px);
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--rz-line);
    background: var(--rz-surface);
    border-radius: var(--rz-radius-m);
    color: var(--rz-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}

.topbar-icon-btn:hover {
    background: var(--rz-sunken);
}

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

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

.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--rz-line);
}

.topbar-start,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-menu {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--rz-line);
    background: var(--rz-surface);
    border-radius: var(--rz-radius-m);
    color: var(--rz-ink);
    font-size: 20px;
    align-items: center;
    justify-content: center;
}

.page-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--rz-ink);
    margin: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--rz-ink);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--rz-line);
    background: var(--rz-surface);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--rz-ink);
}

.user-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.language-switcher .form-select {
    min-width: 7.5rem;
    border-color: var(--rz-line);
}

.admin-content {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 28px 32px 56px;
}

/* ---------- page header ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 24px !important;
    border-bottom: 1px solid var(--rz-line);
}

.page-header-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.page-header-title {
    font-size: 28px;
    line-height: 36px;
    font-weight: 600;
    color: var(--rz-ink);
    margin: 0;
    letter-spacing: -0.01em;
}

.page-header-subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--rz-muted);
    max-width: 68ch;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* ---------- containers ---------- */
.card-admin {
    background: var(--rz-surface);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-l);
    box-shadow: var(--rz-shadow-card);
}

/* ---------- panel: head / sections / foot ---------- */
.rz-panel {
    background: var(--rz-surface);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-l);
    box-shadow: var(--rz-shadow-card);
    overflow: hidden;
    overflow: clip;
}

.rz-panel > .rz-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 16px 24px;
    border-bottom: 1px solid var(--rz-line);
}

.rz-panel-head-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rz-panel-hint {
    margin: 0;
    font-size: 13px;
    color: var(--rz-muted);
}

.rz-panel-body {
    padding: 20px 24px;
}

.rz-form-section {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 16px 32px;
    padding: 22px 24px;
}

.rz-form-section + .rz-form-section {
    border-top: 1px solid var(--rz-line);
}

.rz-form-section-head h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--rz-ink);
}

.rz-form-section-head p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--rz-muted);
}

.rz-form-section-body {
    min-width: 0;
}

.rz-form-section-body > .row:last-child,
.rz-form-section-body > .mb-3:last-child {
    margin-bottom: 0 !important;
}

.rz-panel-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 24px;
    background: var(--rz-sunken);
    border-top: 1px solid var(--rz-line);
}

.rz-panel-foot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-inline-start: auto;
}

.rz-quote {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    font-size: 14px;
    color: var(--rz-muted);
}

.rz-quote strong {
    color: var(--rz-ink);
    font-weight: 600;
}

@media (max-width: 860px) {
    .rz-form-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.card-admin > h5:first-child,
.card-admin h5.text-heading {
    font-size: 18px;
}

.rz-panel-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--rz-ink);
    margin: 0;
}

/* ---------- KPI / figures ---------- */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--rz-surface);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-l);
    padding: 18px 20px;
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
}

.kpi-value {
    font-size: 30px;
    line-height: 1.2;
    font-weight: 500;
    color: var(--rz-ink);
}

.kpi-label {
    font-size: 13px;
    color: var(--rz-muted);
}

/* ---------- status bubble (status-pill kept as the class name) ---------- */
.status-pill,
.rz-bubble {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 0 12px;
    border-radius: 13px;
    border-end-start-radius: var(--rz-radius-tail);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.2;
}

.status-pill--action { background: var(--rz-brand); color: var(--rz-on-brand); font-weight: 600; }
.status-pill--success { background: var(--rz-good-bg); color: var(--rz-good-fg); }
.status-pill--pending { background: var(--rz-pending-bg); color: var(--rz-pending-fg); }
.status-pill--warning { background: var(--rz-pending-bg); color: var(--rz-pending-fg); }
.status-pill--info { background: var(--rz-info-bg); color: var(--rz-info-fg); }
.status-pill--danger { background: var(--rz-danger-bg); color: var(--rz-danger-fg); }
.status-pill--neutral { background: var(--rz-neutral-bg); color: var(--rz-neutral-fg); }

.status-pill--live::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: rz-pulse 1.4s ease-in-out infinite;
}

@keyframes rz-pulse {
    50% { opacity: 0.25; }
}

/* ---------- tables ---------- */
.table-admin {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--rz-canvas);
    --bs-table-color: var(--rz-text);
    font-size: 14px;
    margin-bottom: 0;
}

.table-admin th {
    background: var(--rz-sunken);
    color: var(--rz-muted);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 16px;
    border-top: 1px solid var(--rz-line);
    border-bottom: 1px solid var(--rz-line);
    white-space: nowrap;
}

.table-admin td {
    padding: var(--rz-cell-pad, 12px 16px);
    border-color: var(--rz-line);
    vertical-align: middle;
}

.table-admin tbody tr:hover > td {
    background: var(--rz-canvas);
}

.table-admin tbody tr.is-waiting > td {
    background: var(--rz-waiting-tint);
}

.table-admin tbody tr.is-selected > td {
    background: var(--rz-select);
}

.table-admin tbody tr.table-secondary > td {
    background: var(--rz-sunken);
    color: var(--rz-muted);
}

.table-admin .cell-title {
    display: block;
    color: var(--rz-ink);
    font-weight: 500;
}

.table-admin .cell-caption {
    display: block;
    font-size: 12.5px;
    color: var(--rz-muted);
}

.table-admin .cell-num {
    text-align: end;
    color: var(--rz-ink);
}

.table-admin .cell-actions {
    text-align: end;
    white-space: nowrap;
}

.cell-actions .btn + .btn,
.cell-actions form + .btn,
.cell-actions .btn + form,
.cell-actions form + form {
    margin-inline-start: 4px;
}

/* the one container with a large radius: the table */
.rz-table {
    background: var(--rz-surface);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-l);
    position: relative;
}

.rz-table.card-admin {
    padding: 0 !important;
}

.rz-table-scroll {
    overflow-x: auto;
}

.rz-table-scroll .table-admin th:first-child,
.rz-table-scroll .table-admin td:first-child {
    padding-inline-start: 20px;
}

.rz-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
}

.rz-table {
    box-shadow: var(--rz-shadow-card);
}

.rz-table > .rz-footer {
    border-top: 1px solid var(--rz-line);
    background: var(--rz-raised);
    border-radius: 0 0 var(--rz-radius-l) var(--rz-radius-l);
}

.rz-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    flex: 1 1 240px;
    max-width: 360px;
    padding: 0 12px;
    border: 1px solid var(--rz-line-strong);
    border-radius: var(--rz-radius-m);
    background: var(--rz-surface);
    color: var(--rz-muted);
    margin: 0;
}

.rz-search:focus-within {
    outline: 2px solid var(--rz-focus);
    outline-offset: 2px;
}

.rz-search input {
    border: 0;
    outline: 0;
    background: transparent;
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 14px;
    color: var(--rz-ink);
}

.rz-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rz-toolbar-actions .btn {
    --bs-btn-border-color: var(--rz-line);
    min-height: 40px;
}

/* filter written as a sentence: lead text + native selects styled as slots */
.rz-sentence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 16px 14px;
    padding: 8px 12px;
    background: var(--rz-sunken);
    border-radius: var(--rz-radius-m);
    font-size: 15px;
    line-height: 32px;
    color: var(--rz-muted);
}

.rz-slot {
    appearance: none;
    -webkit-appearance: none;
    height: 32px;
    padding-block: 0;
    padding-inline: 10px 28px;
    border: 1px solid var(--rz-line-strong);
    border-radius: var(--rz-radius-s);
    background-color: var(--rz-surface);
    background-image: var(--rz-chevron);
    background-repeat: no-repeat;
    background-position: left 10px center;
    color: var(--rz-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    max-width: 100%;
}

[dir="ltr"] .rz-slot {
    padding-inline: 10px 28px;
    background-position: right 10px center;
}

.rz-slot.is-set {
    border-color: var(--rz-brand);
    background-color: var(--rz-brand-tint);
}

.rz-sentence-clear {
    margin-inline-start: auto;
    border: 0;
    background: none;
    color: var(--rz-brand-text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.rz-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--rz-muted);
}

.rz-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.rz-page {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--rz-line);
    background: var(--rz-surface);
    border-radius: var(--rz-radius-s);
    color: var(--rz-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.rz-page[aria-current="page"] {
    background: var(--rz-ink);
    border-color: var(--rz-ink);
    color: var(--rz-on-ink);
}

.rz-page:disabled {
    opacity: 0.45;
    cursor: default;
}

.rz-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.rz-page-size select {
    min-height: 32px;
    width: auto;
}

.rz-empty {
    padding: 48px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.rz-empty-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--rz-ink);
}

.rz-empty-text {
    margin: 0;
    font-size: 14px;
    color: var(--rz-muted);
    max-width: 44ch;
}

.rz-typing {
    width: 64px;
    height: 44px;
    background: var(--rz-brand-tint);
    border-radius: 22px 22px var(--rz-radius-tail) 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.rz-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rz-brand-text);
}

/* ---------- meters ---------- */
.rz-meter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rz-meter-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
}

.rz-meter-label {
    color: var(--rz-ink);
    font-weight: 500;
}

.rz-meter-value {
    color: var(--rz-muted);
    font-size: 13px;
}

.rz-meter-value b {
    color: var(--rz-ink);
    font-weight: 500;
}

.rz-track {
    height: 8px;
    border-radius: 4px;
    background: var(--rz-sunken);
    overflow: hidden;
}

.rz-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--rz-good-fg);
}

.rz-meter.is-near .rz-fill { background: var(--rz-brand); }
.rz-meter.is-full .rz-fill { background: var(--rz-danger-fg); }

.rz-meter-note {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--rz-brand-text);
}

.rz-meter.is-full .rz-meter-note {
    color: var(--rz-danger-fg);
}

.rz-inline-meter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--rz-muted);
}

.rz-inline-meter .rz-track {
    width: 110px;
    height: 6px;
}

/* ---------- collapsible create panel ---------- */
.rz-create-panel {
    margin-bottom: 20px;
}

.rz-create-panel .card-admin {
    padding: 24px !important;
}

.rz-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

/* ---------- home ---------- */
.rz-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    align-items: start;
}

.rz-list-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 12px;
}

.rz-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--rz-line);
    text-decoration: none;
    color: var(--rz-text);
}

a.rz-list-row:hover {
    background: var(--rz-canvas);
    color: var(--rz-text);
}

.rz-list-row i {
    font-size: 18px;
    color: var(--rz-muted);
    width: 22px;
    text-align: center;
}

.rz-list-row-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rz-list-row-text strong {
    font-weight: 500;
    color: var(--rz-ink);
}

.rz-list-row-text span {
    font-size: 13px;
    color: var(--rz-muted);
}

.rz-hero-figure {
    font-size: 48px;
    line-height: 1.1;
    font-weight: 500;
    color: var(--rz-ink);
    font-variation-settings: "HEXP" 40;
}

/* ---------- approvals (rendered by approvals.js) ---------- */
.approvals-list {
    display: flex;
    flex-direction: column;
}

.approval-card {
    display: block;
    padding: 14px 20px !important;
    border: 0 !important;
    border-top: 1px solid var(--rz-line) !important;
    border-radius: 0 !important;
    margin: 0 !important;
    color: var(--rz-text);
    text-decoration: none;
}

.approval-card:hover {
    background: var(--rz-canvas);
    color: var(--rz-text);
}

.approval-card .fw-bold {
    font-weight: 500 !important;
    color: var(--rz-ink);
}

/* ---------- alerts list ---------- */
.alert-item {
    padding: 12px 16px;
    border-radius: var(--rz-radius-m);
    margin-bottom: 8px;
    font-size: 14px;
    background: var(--rz-sunken);
    border: 0;
}

.alert-item--warning { background: var(--rz-brand-tint); color: var(--rz-alert-warning); }
.alert-item--danger { background: var(--rz-danger-bg); color: var(--rz-alert-danger); }

/* ---------- excel drop zone ---------- */
.excel-drop-zone {
    border: 1.5px dashed var(--rz-line-strong) !important;
    border-radius: var(--rz-radius-m) !important;
    background: var(--rz-surface);
    transition: border-color 150ms ease, background-color 150ms ease;
}

.excel-drop-zone:hover,
.excel-drop-zone.is-dragover {
    border-color: var(--rz-brand) !important;
    background: var(--rz-waiting-tint);
}

/* ---------- packages ---------- */
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.package-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.package-card {
    position: relative;
    background: var(--rz-surface);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-l);
    padding: 20px;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.package-card--pickable {
    cursor: pointer;
}

.package-card--pickable:hover {
    border-color: var(--rz-line-strong);
}

.package-card--selected {
    border-color: var(--rz-brand);
    background: var(--rz-waiting-tint);
    box-shadow: inset 0 0 0 1px var(--rz-brand);
}

.package-card-badge {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    background: var(--rz-brand);
    color: var(--rz-on-brand);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 11px;
    border-end-start-radius: var(--rz-radius-tail);
}

.package-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--rz-ink);
    margin-bottom: 12px;
}

.package-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--rz-text);
}

.package-card-features li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.package-card-pick-label {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--rz-brand-text);
}

/* ---------- busy buttons (site.js) ---------- */
.btn.is-busy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}

.btn.is-busy .resaala-btn-spinner {
    flex-shrink: 0;
}

.btn.is-busy .resaala-btn-label {
    opacity: 0.85;
}

/* ---------- responsive ---------- */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(100%);
        transition: transform 200ms ease;
        background: var(--rz-surface);
        box-shadow: var(--rz-shadow-pop);
    }

    [dir="ltr"] .admin-sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .admin-sidebar {
        transform: none;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: var(--rz-backdrop);
    }

    .admin-main {
        margin-inline-start: 0;
    }

    .topbar-menu {
        display: inline-flex;
    }

    .admin-topbar,
    .admin-content {
        padding-inline: 16px;
    }

    .user-name {
        display: none;
    }

    .page-header-title {
        font-size: 26px;
        line-height: 34px;
    }
}

@media (max-width: 640px) {
    .rz-search {
        max-width: none;
    }

    .rz-cards thead {
        display: none;
    }

    .rz-cards tbody tr:not([hidden]) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 8px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--rz-line);
    }

    .rz-cards tbody td {
        border: 0;
        padding: 0 !important;
        flex: 0 0 auto;
        background: transparent !important;
    }

    .rz-cards tbody td:first-child,
    .rz-cards tbody td[data-label],
    .rz-cards tbody td.cell-actions {
        flex: 1 1 100%;
    }

    .rz-cards tbody td[data-label] {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        font-size: 14px;
    }

    .rz-cards tbody td[data-label]::before {
        content: attr(data-label);
        font-size: 13px;
        color: var(--rz-muted);
        direction: inherit;
    }

    [dir="rtl"] .rz-cards tbody td.mono[data-label] {
        flex-direction: row-reverse;
    }

    .rz-cards tbody td.cell-actions {
        text-align: start;
        padding-top: 4px !important;
    }

    .rz-cards tbody td.cell-actions:empty {
        display: none;
    }

    .admin-topbar .page-title {
        display: none;
    }
}

.rz-sort-btn {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.rz-sort-btn i {
    font-size: 12px;
    opacity: 0.6;
}

th[aria-sort="ascending"] .rz-sort-btn,
th[aria-sort="descending"] .rz-sort-btn {
    color: var(--rz-ink);
}

th[aria-sort="ascending"] .rz-sort-btn i,
th[aria-sort="descending"] .rz-sort-btn i {
    opacity: 1;
    color: var(--rz-brand-text);
}

.rz-page-gap {
    padding: 0 4px;
    color: var(--rz-muted);
}

[dir="ltr"] .rz-list-row .bi-chevron-left {
    transform: scaleX(-1);
}

.rz-list-row > .bi-chevron-left {
    font-size: 14px;
    width: auto;
}

.rz-panel-body > .mb-3:last-child,
.rz-panel-body > form > .mb-3:last-child {
    margin-bottom: 0 !important;
}

.rz-create-panel > .rz-panel,
.rz-create-panel .row > [class*="col"] > .rz-panel {
    box-shadow: var(--rz-shadow-card);
}

/* ---------- Tom Select (searchable dropdowns) skinned with Resaala tokens ---------- */
.ts-wrapper.form-select,
.ts-wrapper.form-control {
    padding: 0 !important;
    min-height: 0;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

.ts-wrapper .ts-control,
.ts-wrapper.form-select .ts-control,
.ts-wrapper.form-select.single.input-active .ts-control,
.ts-wrapper.single.input-active .ts-control {
    min-height: 42px;
    padding: 8px 12px !important;
    padding-inline-end: 36px !important;
    border: 1px solid var(--rz-line-strong) !important;
    border-radius: var(--rz-radius-m) !important;
    background-color: var(--rz-surface) !important;
    color: var(--rz-ink);
    font-size: 15px;
    line-height: 1.5;
    align-items: center;
    cursor: pointer;
}

/* the theme clears the control background with :not(.disabled); match that specificity */
.ts-wrapper.form-select:not(.disabled) .ts-control,
.ts-wrapper.form-control:not(.disabled) .ts-control,
.ts-wrapper:not(.disabled) .ts-control {
    background-color: var(--rz-surface) !important;
}

.ts-wrapper.form-select.single:not(.disabled) .ts-control,
.ts-wrapper.single:not(.disabled) .ts-control {
    background-image: var(--rz-chevron) !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
}

[dir="ltr"] .ts-wrapper.form-select.single:not(.disabled) .ts-control,
[dir="ltr"] .ts-wrapper.single:not(.disabled) .ts-control {
    background-position: right 12px center !important;
}

.ts-wrapper.single .ts-control::after {
    display: none;
}

.ts-wrapper:not(.focus):hover .ts-control {
    border-color: var(--rz-muted) !important;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--rz-focus) !important;
    box-shadow: 0 0 0 3px var(--rz-focus-ring) !important;
}

.ts-wrapper.disabled .ts-control {
    background-color: var(--rz-sunken) !important;
    color: var(--rz-muted);
    opacity: 1;
}

.ts-control > input,
.ts-control > input::placeholder {
    color: var(--rz-ink);
    font: inherit;
}

.ts-control > input::placeholder,
.ts-wrapper .ts-control .placeholder {
    color: var(--rz-muted);
}

.ts-wrapper.multi .ts-control {
    gap: 6px;
    padding-block: 6px !important;
}

.ts-wrapper.multi.has-items .ts-control {
    padding-inline-start: 6px !important;
}

.ts-wrapper.multi .ts-control > .item,
.ts-wrapper.multi .ts-control > div {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 2px 4px 2px 10px;
    padding-inline: 10px 4px;
    border: 0;
    border-radius: 13px;
    border-end-start-radius: var(--rz-radius-tail);
    background: var(--rz-brand-tint);
    color: var(--rz-ink);
    font-size: 13px;
    font-weight: 500;
    line-height: 22px;
}

.ts-wrapper.plugin-remove_button .item .remove,
.ts-wrapper.plugin-remove_button.rtl .item .remove,
.ts-wrapper.plugin-remove_button:not(.rtl) .item .remove {
    border: 0 !important;
    margin: 0 !important;
    padding: 0 6px;
    border-radius: 10px;
    color: var(--rz-muted);
    font-size: 15px;
    line-height: 20px;
}

.ts-wrapper.plugin-remove_button .item .remove:hover {
    background: color-mix(in srgb, var(--rz-ink) 10%, transparent);
    color: var(--rz-ink);
}

.ts-dropdown {
    margin-top: 6px;
    padding: 6px;
    border: 1px solid var(--rz-line);
    border-radius: 12px;
    background: var(--rz-surface);
    color: var(--rz-text);
    box-shadow: var(--rz-shadow-pop);
    z-index: 1080;
    font-size: 14px;
}

.ts-dropdown .ts-dropdown-content {
    max-height: 280px;
    padding: 2px;
}

.ts-dropdown .option,
.ts-dropdown .no-results,
.ts-dropdown .create {
    padding: 8px 10px;
    border-radius: 8px;
}

.ts-dropdown .option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
}

.ts-dropdown .active,
.ts-dropdown .option:hover {
    background: var(--rz-sunken);
    color: var(--rz-ink);
}

.ts-dropdown .option.selected {
    background: var(--rz-brand-tint);
    color: var(--rz-ink);
    font-weight: 500;
}

.ts-dropdown .option.selected::after {
    font-family: "bootstrap-icons";
    content: "\f272";
    color: var(--rz-brand-text);
    font-size: 16px;
}

.ts-dropdown .no-results {
    color: var(--rz-muted);
    text-align: center;
}

.ts-dropdown .highlight {
    background: color-mix(in srgb, var(--rz-brand) 30%, transparent);
    color: inherit;
    border-radius: 3px;
}

/* Bootstrap dropdown menus (row actions, "..." menus, top bar): the same look as the lists of the
   searchable selects above, instead of Bootstrap's defaults (16px text, mixed item sizes). */
.dropdown-menu {
    --bs-dropdown-zindex: 1080;
    min-width: 180px;
    padding: 6px;
    border: 1px solid var(--rz-line);
    border-radius: 12px;
    background: var(--rz-surface);
    color: var(--rz-text);
    box-shadow: var(--rz-shadow-pop);
    font-size: 14px;
}

.dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--rz-text);
    font-size: 14px;
    line-height: 1.5;
    text-align: start;
    white-space: nowrap;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus-visible {
    background: var(--rz-sunken);
    color: var(--rz-ink);
}

.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active {
    background: var(--rz-brand-tint);
    color: var(--rz-ink);
}

.dropdown-menu .dropdown-item.text-danger {
    font-size: 14px;
}

.dropdown-menu .dropdown-item.text-danger:hover,
.dropdown-menu .dropdown-item.text-danger:focus-visible {
    background: var(--rz-danger-bg);
}

.dropdown-menu .dropdown-item:disabled,
.dropdown-menu .dropdown-item.disabled {
    color: var(--rz-muted);
    background: transparent;
}

.dropdown-menu .dropdown-divider {
    margin: 4px 2px;
    border-top: 1px solid var(--rz-line);
    opacity: 1;
}

.dropdown-menu .dropdown-header {
    padding: 6px 10px 4px;
    color: var(--rz-muted);
    font-size: 12px;
}

.plugin-dropdown_input .dropdown-input-wrap {
    position: relative;
    padding: 2px 2px 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--rz-line);
}

.plugin-dropdown_input .dropdown-input-wrap::before {
    font-family: "bootstrap-icons";
    content: "\f52a";
    position: absolute;
    top: 11px;
    inset-inline-start: 13px;
    font-size: 13px;
    color: var(--rz-muted);
    pointer-events: none;
}

.plugin-dropdown_input .dropdown-input {
    width: 100%;
    min-height: 38px;
    padding: 6px 12px;
    padding-inline-start: 34px;
    border: 1px solid var(--rz-line-strong);
    border-radius: 8px;
    background: var(--rz-surface);
    color: var(--rz-ink);
    font: inherit;
    font-size: 14px;
    box-shadow: none;
}

.plugin-dropdown_input .dropdown-input:focus {
    outline: 0;
    border-color: var(--rz-focus);
    box-shadow: 0 0 0 3px var(--rz-focus-ring);
}

.plugin-dropdown_input.focus.dropdown-active .ts-control {
    border-color: var(--rz-focus);
    box-shadow: 0 0 0 3px var(--rz-focus-ring);
}

/* ---------- tables use the whole width of the page ---------- */
.rz-table .table-admin {
    width: 100%;
    table-layout: auto;
}

.rz-table .table-admin td.cell-actions,
.rz-table .table-admin th:last-child {
    width: 1%;
}

.rz-table .table-admin th:last-child,
.rz-table .table-admin td:last-child {
    padding-inline-end: 20px;
}

@media (min-width: 1600px) {
    .admin-content {
        padding-inline: 40px;
    }
}


/* ---------- confirmation dialog ---------- */
.rz-confirm .modal-dialog {
    max-width: 440px;
}

.rz-confirm .modal-content {
    overflow: hidden;
}

.rz-confirm-body {
    display: flex;
    gap: 16px;
    padding: 24px 24px 20px;
}

.rz-confirm-icon {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 20px;
    border-end-start-radius: var(--rz-radius-tail);
    display: grid;
    place-items: center;
    font-size: 18px;
}

.rz-confirm--danger .rz-confirm-icon { background: var(--rz-danger-bg); color: var(--rz-danger-fg); }
.rz-confirm--primary .rz-confirm-icon { background: var(--rz-brand-tint); color: var(--rz-brand-text); }

.rz-confirm-copy {
    min-width: 0;
}

.rz-confirm-title {
    margin: 4px 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: var(--rz-ink);
}

.rz-confirm-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--rz-text);
}

.rz-confirm-reason {
    margin-top: 14px;
}

.rz-confirm-reason .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rz-ink);
}

.rz-confirm-reason textarea {
    min-height: 88px;
    resize: vertical;
}

.rz-confirm-copy {
    flex: 1 1 auto;
}

.rz-confirm-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px;
    background: var(--rz-sunken);
    border-top: 1px solid var(--rz-line);
}

.btn-rz-danger {
    --bs-btn-color: var(--rz-on-ink);
    --bs-btn-bg: var(--rz-danger-fg);
    --bs-btn-border-color: var(--rz-danger-fg);
    --bs-btn-hover-color: var(--rz-on-ink);
    --bs-btn-hover-bg: color-mix(in srgb, var(--rz-danger-fg) 88%, var(--rz-ink));
    --bs-btn-hover-border-color: color-mix(in srgb, var(--rz-danger-fg) 88%, var(--rz-ink));
    --bs-btn-active-color: var(--rz-on-ink);
    --bs-btn-active-bg: var(--rz-danger-fg);
    --bs-btn-active-border-color: var(--rz-danger-fg);
}

/* ---------- file drop zone ---------- */
.rz-file {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 12px 16px;
    margin: 0;
    border: 1.5px dashed var(--rz-line-strong);
    border-radius: var(--rz-radius-m);
    background: var(--rz-surface);
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.rz-file:hover,
.rz-file.is-dragover {
    border-color: var(--rz-brand);
    background: var(--rz-waiting-tint);
}

.rz-file:focus-within {
    outline: 2px solid var(--rz-focus);
    outline-offset: 2px;
}

.rz-file.has-file {
    border-style: solid;
    border-color: var(--rz-line);
}

.rz-file-icon {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 20px;
    border-end-start-radius: var(--rz-radius-tail);
    background: var(--rz-brand-tint);
    color: var(--rz-brand-text);
    display: grid;
    place-items: center;
    font-size: 18px;
}

.rz-file-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rz-file-text strong {
    font-size: 14px;
    font-weight: 500;
    color: var(--rz-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rz-file-hint {
    font-size: 12.5px;
    color: var(--rz-muted);
}

.rz-file-thumb {
    width: 48px;
    height: 48px;
    flex: none;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--rz-line);
}

.rz-file-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ---------- flatpickr calendar skinned with Resaala tokens ---------- */
.rz-date-input[readonly] {
    background-color: var(--rz-surface);
    cursor: pointer;
}

.flatpickr-calendar {
    font-family: var(--rz-font);
    background: var(--rz-surface);
    border: 1px solid var(--rz-line);
    border-radius: 12px;
    box-shadow: var(--rz-shadow-pop);
    color: var(--rz-text);
    width: 316px;
    padding: 6px;
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after {
    display: none;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month input.cur-year,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: var(--rz-ink);
    fill: var(--rz-ink);
    background: transparent;
    font-weight: 600;
}

.flatpickr-current-month {
    font-size: 15px;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--rz-muted);
    fill: var(--rz-muted);
    border-radius: 8px;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--rz-brand-text);
}

[dir="rtl"] .flatpickr-months .flatpickr-prev-month svg,
[dir="rtl"] .flatpickr-months .flatpickr-next-month svg {
    transform: scaleX(-1);
}

span.flatpickr-weekday {
    color: var(--rz-muted);
    font-weight: 500;
    font-size: 12px;
}

.flatpickr-days,
.dayContainer {
    width: 302px;
    min-width: 302px;
    max-width: 302px;
}

.flatpickr-day {
    color: var(--rz-text);
    border-radius: 10px;
    max-width: 42px;
    height: 38px;
    line-height: 38px;
    font-variant-numeric: tabular-nums;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
    background: var(--rz-sunken);
    border-color: transparent;
    color: var(--rz-ink);
}

.flatpickr-day.today {
    border-color: var(--rz-brand);
}

.flatpickr-day.today:hover {
    background: var(--rz-brand-tint);
    color: var(--rz-ink);
    border-color: var(--rz-brand);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: var(--rz-brand);
    border-color: var(--rz-brand);
    color: var(--rz-on-brand);
    font-weight: 600;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: color-mix(in srgb, var(--rz-muted) 55%, transparent);
    background: transparent;
}

.flatpickr-time {
    border-top: 1px solid var(--rz-line) !important;
    margin-top: 4px;
}

.flatpickr-time input,
.flatpickr-time .flatpickr-am-pm,
.flatpickr-time .flatpickr-time-separator {
    color: var(--rz-ink);
    font-weight: 500;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
    background: var(--rz-sunken);
}

.numInputWrapper span.arrowUp::after { border-bottom-color: var(--rz-muted); }
.numInputWrapper span.arrowDown::after { border-top-color: var(--rz-muted); }

.sidebar-flag {
    margin-inline-start: auto;
    padding: 1px 8px;
    border-radius: 10px;
    border-end-start-radius: var(--rz-radius-tail);
    background: var(--rz-danger-bg);
    color: var(--rz-danger-fg);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- compose: fields beside a live phone preview ---------- */
.rz-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 28px;
    align-items: start;
}

.rz-compose-fields {
    min-width: 0;
}

.rz-compose-fields > .mb-3:last-child {
    margin-bottom: 0 !important;
}

@media (max-width: 1199.98px) {
    .rz-compose {
        grid-template-columns: 1fr;
    }
}

.rz-phone {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: calc(var(--rz-topbar-height) + 16px);
}

.rz-phone-caption {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--rz-muted);
}

.rz-phone-frame {
    border: 8px solid #1D1F20;
    box-shadow: 0 0 0 1px var(--rz-line);
    border-radius: 34px;
    background: var(--rz-chat-bg);
    overflow: hidden;
    min-height: 360px;
    display: flex;
    flex-direction: column;
}

.rz-phone-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 14px 12px;
    background: var(--rz-surface);
    border-bottom: 1px solid var(--rz-line);
}

.rz-phone-avatar {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    background: var(--rz-brand);
    color: var(--rz-on-brand);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 15px;
    object-fit: cover;
}

.rz-phone-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.rz-phone-who strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--rz-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rz-phone-who span {
    font-size: 11.5px;
    color: var(--rz-muted);
}

.rz-phone-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 12px 18px;
}

.rz-phone-day {
    align-self: center;
    font-size: 11px;
    color: var(--rz-muted);
    background: var(--rz-surface);
    border-radius: 10px;
    padding: 2px 10px;
}

.rz-phone-bubble {
    max-width: 92%;
    background: var(--rz-surface);
    color: var(--rz-ink);
    border-radius: 16px;
    border-start-start-radius: var(--rz-radius-tail);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rz-phone-image {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
}

.rz-phone-text {
    margin: 0;
    padding: 2px 6px 0;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.rz-phone-text.is-empty {
    color: var(--rz-muted);
    font-style: normal;
}

.rz-phone-time {
    align-self: flex-end;
    padding: 0 6px 2px;
    font-size: 10.5px;
    color: var(--rz-muted);
}

.rz-phone-count {
    margin: 0;
    min-height: 18px;
    font-size: 12.5px;
    color: var(--rz-muted);
    text-align: center;
}

/* approval details: decision on one side, the message as the customer sees it on the other */
.rz-approval-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 32px;
    align-items: start;
}

.rz-approval-main {
    min-width: 0;
}

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

.rz-sep::before { content: "\060C\00A0"; }
[dir="ltr"] .rz-sep::before { content: ",\00A0"; }

/* ---------- delivery trail ---------- */
.rz-trail {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.rz-trail--full {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

.rz-trail-bar {
    display: flex;
    gap: 2px;
    height: 6px;
    width: 96px;
    flex: none;
}

.rz-trail--full .rz-trail-bar {
    width: 100%;
    height: 14px;
}

.rz-trail-bar > span {
    min-width: 3px;
    border-radius: 3px;
}

.rz-trail--full .rz-trail-bar > span {
    border-radius: 4px;
}

.rz-trail-opened { background: var(--rz-trail-replied); }
.rz-trail-sent { background: var(--rz-trail-delivered); }
.rz-trail-pending {
    background: repeating-linear-gradient(135deg, var(--rz-trail-sent) 0 3px, transparent 3px 6px);
    box-shadow: inset 0 0 0 1px var(--rz-trail-sent);
}
.rz-trail-failed { background: var(--rz-danger-fg); }

.rz-trail-label {
    font-size: 13px;
    color: var(--rz-ink);
    white-space: nowrap;
}

.rz-trail-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 0;
}

.rz-trail-legend > div {
    border-inline-start: 1px solid var(--rz-line);
    padding-inline-start: 12px;
}

.rz-trail-legend dt {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--rz-muted);
}

.rz-trail-legend dd {
    margin: 2px 0 0;
    font-size: 22px;
    font-weight: 500;
    color: var(--rz-ink);
}

.rz-trail-key {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}


/* ---------- details pages ---------- */
.rz-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--rz-muted);
}

.rz-breadcrumb a {
    color: var(--rz-muted);
    text-decoration: none;
}

.rz-breadcrumb a:hover {
    color: var(--rz-ink);
    text-decoration: underline;
}

.rz-breadcrumb i {
    font-size: 11px;
}

[dir="ltr"] .rz-breadcrumb .bi-chevron-left {
    transform: scaleX(-1);
}

.rz-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 70ch;
}

.rz-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.rz-detail-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

@media (max-width: 1199.98px) {
    .rz-detail-grid {
        grid-template-columns: 1fr;
    }
}

.rz-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 0;
}

.rz-facts > div {
    padding: 16px 24px;
    border-bottom: 1px solid var(--rz-line);
}

.rz-facts dt {
    font-size: 13px;
    font-weight: 400;
    color: var(--rz-muted);
    margin-bottom: 4px;
}

.rz-facts dd {
    margin: 0;
    font-size: 15px;
    color: var(--rz-ink);
}

.rz-fact-strong {
    font-weight: 600;
    font-size: 17px !important;
}

.rz-timeline {
    list-style: none;
    margin: 0;
    padding: 8px 24px 16px;
}

.rz-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
}

.rz-timeline li + li::before {
    content: "";
    position: absolute;
    top: -14px;
    inset-inline-start: 9px;
    width: 2px;
    height: 26px;
    background: var(--rz-line);
}

.rz-timeline-dot {
    width: 20px;
    height: 16px;
    margin-top: 3px;
    border-radius: 8px;
    border-end-start-radius: 3px;
    background: var(--rz-neutral-bg);
    box-shadow: inset 0 0 0 2px var(--rz-line-strong);
}

.rz-timeline-dot.is-good { background: var(--rz-good-bg); box-shadow: inset 0 0 0 2px var(--rz-good-fg); }
.rz-timeline-dot.is-danger { background: var(--rz-danger-bg); box-shadow: inset 0 0 0 2px var(--rz-danger-fg); }

.rz-timeline li > div {
    display: flex;
    flex-direction: column;
}

.rz-timeline strong {
    font-weight: 500;
    color: var(--rz-ink);
}

.rz-timeline li > div span {
    font-size: 13px;
    color: var(--rz-muted);
}

.rz-timeline .rz-time {
    font-size: 13px;
    color: var(--rz-muted);
    white-space: nowrap;
}

.table-admin a.cell-link {
    color: var(--rz-ink);
    text-decoration: none;
    display: block;
    max-width: 100%;
}

.table-admin a.cell-link:hover {
    color: var(--rz-brand-text);
    text-decoration: underline;
}

/* ---------- home: setup steps and the "waiting on you" list ---------- */
.rz-setup .rz-panel-head {
    flex-wrap: wrap;
}

.rz-setup-track {
    width: 180px;
    height: 6px;
}

.rz-setup-track .rz-fill {
    background: var(--rz-brand);
}

.rz-setup-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rz-setup-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    min-width: 0;
}

.rz-setup-step + .rz-setup-step {
    border-inline-start: 1px solid var(--rz-line);
}

.rz-setup-mark {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    border-end-start-radius: var(--rz-radius-tail);
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 600;
    background: var(--rz-sunken);
    color: var(--rz-muted);
}

.rz-setup-step.is-next .rz-setup-mark {
    background: var(--rz-brand);
    color: var(--rz-on-brand);
}

.rz-setup-step.is-done .rz-setup-mark {
    background: var(--rz-good-bg);
    color: var(--rz-good-fg);
}

.rz-setup-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rz-setup-text strong {
    font-weight: 600;
    color: var(--rz-ink);
}

.rz-setup-text span {
    font-size: 13px;
    color: var(--rz-muted);
    line-height: 1.5;
}

.rz-setup-step.is-done .rz-setup-text strong {
    color: var(--rz-muted);
    text-decoration: line-through;
    text-decoration-color: var(--rz-line-strong);
}

.rz-setup-state {
    font-size: 13px;
    font-weight: 500;
    color: var(--rz-good-fg);
}

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

    .rz-setup-step + .rz-setup-step {
        border-inline-start: 0;
        border-top: 1px solid var(--rz-line);
    }
}

.rz-list-dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    border-end-start-radius: 2px;
}

.rz-list-dot--action { background: var(--rz-brand); }
.rz-list-dot--info { background: var(--rz-info-fg); }
.rz-list-dot--danger { background: var(--rz-danger-fg); }

.rz-list-row-text > span {
    display: block;
    max-width: 100%;
}

.rz-list-row-meta {
    flex: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--rz-ink);
    white-space: nowrap;
}

.rz-list-row .sidebar-count {
    margin-inline-start: 0;
}

.rz-empty--compact {
    padding: 28px 20px 32px;
    border-top: 1px solid var(--rz-line);
}

.rz-toolbar > .rz-panel-title {
    margin: 0;
}

/* ---------- subscription page ---------- */
.rz-usage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rz-usage-grid > .rz-meter {
    padding: 20px 24px;
}

.rz-usage-grid > .rz-meter + .rz-meter {
    border-inline-start: 1px solid var(--rz-line);
}

@media (max-width: 860px) {
    .rz-usage-grid {
        grid-template-columns: 1fr;
    }

    .rz-usage-grid > .rz-meter + .rz-meter {
        border-inline-start: 0;
        border-top: 1px solid var(--rz-line);
    }
}

.rz-choice-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rz-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--rz-line-strong);
    border-radius: var(--rz-radius-m);
    background: var(--rz-surface);
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.rz-choice strong {
    font-weight: 600;
    color: var(--rz-ink);
}

.rz-choice span {
    font-size: 13px;
    color: var(--rz-muted);
}

.rz-choice:hover {
    border-color: var(--rz-muted);
}

.btn-check:checked + .rz-choice {
    border-color: var(--rz-brand);
    background: var(--rz-waiting-tint);
    box-shadow: inset 0 0 0 1px var(--rz-brand);
}

.btn-check:focus-visible + .rz-choice {
    outline: 2px solid var(--rz-focus);
    outline-offset: 2px;
}

.rz-choice .rz-choice-badge {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    color: var(--rz-on-brand);
    font-size: 12px;
    min-height: 22px;
    padding: 0 10px;
}

@media (max-width: 575.98px) {
    .rz-choice-group {
        grid-template-columns: 1fr;
    }
}

/* ---------- skeleton (loading) ---------- */
.rz-skeleton-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid var(--rz-line);
}

.rz-skeleton-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rz-skeleton-line,
.rz-skeleton-pill {
    display: block;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--rz-sunken) 0%, var(--rz-line) 50%, var(--rz-sunken) 100%);
    background-size: 200% 100%;
    animation: rz-shimmer 1.2s ease-in-out infinite;
}

.rz-skeleton-line--sub {
    height: 8px;
    opacity: 0.7;
}

.rz-skeleton-pill {
    width: 84px;
    height: 24px;
    border-radius: 12px;
    border-end-start-radius: var(--rz-radius-tail);
}

@keyframes rz-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.approvals-list.is-refreshing {
    opacity: 0.55;
    transition: opacity 120ms ease;
}


/* ==========================================================================
   Server-side lists (data-rz-table="server")
   The URL holds the state; these rules only style the pieces the server renders.
   ========================================================================== */

.rz-table-controls {
    margin: 0;
}

.rz-search-key {
    flex: none;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: grid;
    place-items: center;
    border: 1px solid var(--rz-line);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--rz-raised);
    color: var(--rz-muted);
    font: 500 12px/1 var(--bs-font-monospace);
    box-shadow: none;
}

.rz-search:focus-within .rz-search-key,
.rz-search input:not(:placeholder-shown) ~ .rz-search-key {
    display: none;
}

/* results: dim while the next page is on its way, with a running "delivery" bar on top */
.rz-results {
    position: relative;
    transition: opacity 0.15s ease;
}

.rz-table.is-loading .rz-results {
    opacity: 0.55;
    pointer-events: none;
}

.rz-table.is-loading .rz-results::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 2px;
    z-index: 2;
    background: linear-gradient(90deg, transparent 0 30%, var(--rz-brand) 30% 55%, transparent 55% 100%);
    background-size: 220% 100%;
    animation: rz-trail-run 0.9s linear infinite;
}

@keyframes rz-trail-run {
    from { background-position: 110% 0; }
    to { background-position: -110% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .rz-table.is-loading .rz-results::before {
        animation: none;
        background: var(--rz-brand);
        opacity: 0.6;
    }
}

/* sortable headers are links: the URL changes, so they can be opened in a new tab */
a.rz-sort-btn {
    text-decoration: none;
    margin-inline: -6px;
    padding: 4px 6px;
    border-radius: var(--rz-radius-s);
}

a.rz-sort-btn:hover {
    color: var(--rz-ink);
    background: var(--rz-line);
}

a.rz-sort-btn:focus-visible {
    outline: 2px solid var(--rz-focus);
    outline-offset: 1px;
}

a.rz-sort-btn.is-active {
    color: var(--rz-ink);
}

a.rz-sort-btn.is-active i {
    opacity: 1;
    color: var(--rz-brand-text);
}

.table-admin th.cell-num a.rz-sort-btn {
    flex-direction: row-reverse;
}

/* footer: range on one side, size + pages on the other */
.rz-count {
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.rz-footer-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

.rz-pagesize {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.rz-pagesize .rz-slot {
    height: 30px;
    font-size: 13px;
}

/* the pages sit on one sunken track; the current page is an ink bubble with the system's tail corner */
.rz-pager {
    gap: 2px;
    padding: 2px;
    border-radius: var(--rz-radius-m);
    background: var(--rz-sunken);
}

.rz-pager .rz-page {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rz-text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

.rz-pager a.rz-page:hover {
    background: var(--rz-surface);
    color: var(--rz-ink);
    box-shadow: 0 0 0 1px var(--rz-line);
}

.rz-pager a.rz-page:focus-visible {
    outline: 2px solid var(--rz-focus);
    outline-offset: 1px;
}

.rz-pager .rz-page[aria-current="page"] {
    background: var(--rz-ink);
    color: var(--rz-on-ink);
    font-weight: 600;
    border-end-start-radius: var(--rz-radius-tail);
}

.rz-pager .rz-page.is-disabled {
    opacity: 0.35;
}

.rz-page--step i {
    font-size: 12px;
}

[dir="ltr"] .rz-flip {
    display: inline-block;
    transform: scaleX(-1);
}

.rz-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.rz-jump label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.rz-jump input {
    width: 64px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--rz-line-strong);
    border-radius: var(--rz-radius-s);
    background: var(--rz-surface);
    color: var(--rz-ink);
    font: inherit;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    -moz-appearance: textfield;
}

.rz-jump input::-webkit-outer-spin-button,
.rz-jump input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rz-jump input:focus {
    outline: 2px solid var(--rz-focus);
    outline-offset: 1px;
}

.rz-jump .rz-page {
    border: 1px solid var(--rz-line);
    background: var(--rz-surface);
    display: inline-grid;
    place-items: center;
    height: 30px;
    min-width: 30px;
}

a.rz-sentence-clear {
    text-decoration: none;
}

a.rz-sentence-clear:hover {
    text-decoration: underline;
}

/* cells */
.table-admin .cell-num,
.table-admin .mono {
    font-variant-numeric: tabular-nums;
}

.table-admin td.cell-message {
    max-width: 380px;
    min-width: 220px;
}

.table-admin td.cell-message .cell-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
}

.table-admin .cell-strong {
    display: block;
    color: var(--rz-ink);
    font-weight: 500;
}

.table-admin .cell-empty {
    color: var(--rz-line-strong);
}

.cell-badge {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 0 7px;
    border: 1px solid var(--rz-line);
    border-radius: 9px;
    border-end-start-radius: var(--rz-radius-tail);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 18px;
    color: var(--rz-muted);
    vertical-align: 1px;
}

.cell-person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cell-person-text {
    min-width: 0;
}

.cell-person .rz-avatar {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    border-end-start-radius: var(--rz-radius-tail);
    background: var(--rz-sunken);
    color: var(--rz-text);
    font-size: 14px;
    font-weight: 600;
}

.table-admin tbody tr.is-muted > td {
    color: var(--rz-muted);
}

.table-admin tbody tr.is-muted .cell-title {
    color: var(--rz-muted);
    font-weight: 400;
}

.rz-row-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-height: 0;
    padding-inline-start: 0;
}

.rz-row-switch .form-check-input {
    float: none;
    margin: 0;
}

.rz-row-switch .form-check-label {
    font-size: 13px;
    color: var(--rz-muted);
}

@media (max-width: 640px) {
    .rz-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .rz-footer-controls {
        justify-content: space-between;
    }

    .rz-jump {
        display: none;
    }

    .rz-search-key {
        display: none;
    }
}

/* approvals: cursor paging, one "show more" under the list */
.approvals-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 0 4px;
}

.approvals-more-count {
    font-size: 13px;
    color: var(--rz-muted);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Forms: steps, sentences and counters
   ========================================================================== */

/* a form with two or more sections reads as numbered steps; the number sits in a small ink bubble */
form:has(> .rz-form-section + .rz-form-section) {
    counter-reset: rz-step;
}

form:has(> .rz-form-section + .rz-form-section) > .rz-form-section > .rz-form-section-head h3 {
    counter-increment: rz-step;
    display: flex;
    align-items: center;
    gap: 10px;
}

form:has(> .rz-form-section + .rz-form-section) > .rz-form-section > .rz-form-section-head h3::before {
    content: counter(rz-step);
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border-end-start-radius: var(--rz-radius-tail);
    background: var(--rz-ink);
    color: var(--rz-on-ink);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

form:has(> .rz-form-section + .rz-form-section) > .rz-form-section > .rz-form-section-head p {
    padding-inline-start: 34px;
}

/* the section the person is working in gets the brand marker */
form:has(> .rz-form-section + .rz-form-section) > .rz-form-section:focus-within > .rz-form-section-head h3::before {
    background: var(--rz-brand);
    color: var(--rz-on-brand);
}

/* long forms keep their actions in reach */
.rz-panel form > .rz-panel-foot {
    position: sticky;
    bottom: 0;
    z-index: 4;
    box-shadow: 0 -1px 0 var(--rz-line), 0 -8px 16px -12px rgba(0, 0, 0, 0.18);
}

/* a rule written as a sentence: "every [2] [weeks] at [09:00]" */
.rz-rule,
.rz-range {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.rz-rule legend,
.rz-range legend {
    float: none;
    width: auto;
    font-size: 14px;
    margin-bottom: 8px;
}

.rz-rule-line,
.rz-range-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
    border-radius: var(--rz-radius-m);
    background: var(--rz-sunken);
    color: var(--rz-muted);
    font-size: 15px;
}

.rz-rule-line .form-control,
.rz-rule-line .form-select,
.rz-range-line .form-control {
    width: auto;
    min-height: 38px;
    font-weight: 500;
    color: var(--rz-ink);
}

.rz-rule-num,
.rz-range-line .form-control {
    width: 84px !important;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rz-rule-unit {
    min-width: 120px;
}

.rz-rule-time {
    width: 120px !important;
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

.rz-rule + .form-text,
.rz-rule .form-text,
.rz-range .form-text {
    margin-top: 6px;
}

/* counters under message and number fields */
.rz-counter-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.rz-counter {
    font-size: 12px;
    color: var(--rz-muted);
    font-variant-numeric: tabular-nums;
}

.rz-counter.is-near {
    color: var(--rz-brand-text);
    font-weight: 500;
}

.rz-counter.is-full {
    color: var(--rz-alert-danger);
    font-weight: 600;
}

.rz-counter.is-zero {
    opacity: 0.7;
}

input[type="number"].form-control,
.form-control.mono {
    font-variant-numeric: tabular-nums;
}

.form-control.mono {
    font-family: var(--bs-font-monospace);
    font-size: 14px;
    letter-spacing: 0.02em;
}

@media (max-width: 640px) {
    .rz-rule-line,
    .rz-range-line {
        font-size: 14px;
    }
}

.cell-stack {
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
}

.cell-stack .cell-caption {
    text-align: start;
}

/* approvals table: the request cell carries a thumbnail (or the kind's icon) next to the text */
.cell-request {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.cell-request-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cell-thumb {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border-end-start-radius: var(--rz-radius-tail);
    object-fit: cover;
    background: var(--rz-sunken);
}

.cell-thumb--icon {
    display: grid;
    place-items: center;
    color: var(--rz-muted);
    font-size: 17px;
}

tr.is-waiting .cell-thumb--icon {
    background: var(--rz-brand-tint);
    color: var(--rz-brand-text);
}

.cell-reason {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 240px;
    margin-top: 4px;
    padding-inline-start: 8px;
    border-inline-start: 2px solid var(--rz-line-strong);
    font-size: 12.5px;
    color: var(--rz-text);
}

/* ==========================================================================
   Employee permissions: one switch per action, grouped by area
   ========================================================================== */

.rz-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

/* the permissions section uses the whole width: its head sits above the groups */
.rz-form-section--wide {
    grid-template-columns: 1fr;
}

.rz-perms {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rz-perms-locked {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--rz-radius-m);
    background: var(--rz-sunken);
    color: var(--rz-text);
    font-size: 14px;
}

.rz-perms-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
}

.rz-perms-search {
    flex: 1 1 220px;
    max-width: 320px;
    margin: 0;
}

.rz-perms-template {
    flex: 1 1 360px;
    max-width: 560px;
}

.rz-perms-template-line {
    display: flex;
    gap: 8px;
}

.rz-perms-template-line .form-select,
.rz-perms-template-line .ts-wrapper {
    flex: 1;
}

.rz-perms-count {
    margin: 0;
    padding: 6px 12px;
    border-radius: 13px;
    border-end-start-radius: var(--rz-radius-tail);
    background: var(--rz-ink);
    color: var(--rz-on-ink);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rz-perms-groups {
    /* One column, not a multi-card grid: with ~9 permission groups, several columns of
       independently-expandable cards made the screen feel busy and hard to scan (BUG_035).
       A single stacked accordion plus the per-group "granted" count below reads top to bottom
       like a list, and still collapses each group down to one line until it is opened. */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rz-perm-group {
    margin: 0;
    padding: 0;
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius-m);
    background: var(--rz-surface);
    overflow: hidden;
    min-width: 0;
}

.rz-perm-group-head {
    float: none;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: var(--rz-sunken);
    border-bottom: 1px solid var(--rz-line);
    font-size: 14px;
}

.rz-perm-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--rz-ink);
    cursor: pointer;
}

.rz-perm-group.is-collapsed .rz-perm-group-head {
    border-bottom: 0;
}

.rz-perm-group.is-collapsed .rz-perm-group-body {
    display: none;
}

.rz-perm-group.is-collapsed .rz-perm-group-toggle .bi {
    transform: rotate(-90deg);
}

[dir="rtl"] .rz-perm-group.is-collapsed .rz-perm-group-toggle .bi {
    transform: rotate(90deg);
}

.rz-perm-all {
    border: 0;
    background: none;
    padding: 0;
    color: var(--rz-brand-text);
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}

.rz-perm-all:hover {
    text-decoration: underline;
}

.rz-perm {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 2px 12px;
    padding: 11px 14px;
    border-top: 1px solid var(--rz-line);
    transition: background-color 0.12s ease;
}

.rz-perm-group-body > .rz-perm:first-child {
    border-top: 0;
}

.rz-perm.form-switch {
    padding: 11px 14px;
    min-height: 0;
}

.rz-perm.form-switch .form-check-input {
    float: none;
    margin: 3px 0 0;
    width: 2.2em;
    height: 1.2em;
    cursor: pointer;
}

.rz-perm.is-on {
    background: var(--rz-brand-tint);
}

.rz-perm.is-locked .form-check-input,
.rz-perm.is-locked .rz-perm-text {
    cursor: not-allowed;
}

.rz-perm.is-locked:not(.is-on) {
    opacity: 0.6;
}

.rz-perm-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    min-width: 0;
    cursor: pointer;
}

.rz-perm-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--rz-ink);
    font-size: 14px;
    font-weight: 500;
}

.rz-perm-hint {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--rz-muted);
}

.rz-perm-needs {
    font-size: 12px;
    color: var(--rz-muted);
}

.rz-perm-needs::before {
    content: "\21B3";
    margin-inline-end: 4px;
    color: var(--rz-line-strong);
}

[dir="rtl"] .rz-perm-needs::before {
    content: "\21B2";
}

.rz-perm-flag {
    padding: 0 7px;
    border-radius: 9px;
    border-end-start-radius: var(--rz-radius-tail);
    background: var(--rz-pending-bg);
    color: var(--rz-pending-fg);
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
}

.rz-perm-lock {
    color: var(--rz-muted);
    font-size: 13px;
    margin-top: 2px;
}


/* ---------- company profile ---------- */
.rz-profile-logo {
    width: 72px; height: 72px; border-radius: 18px;
    display: grid; place-items: center; overflow: hidden;
    background: var(--rz-brand-tint); color: var(--rz-brand-text);
    font-size: 28px; font-weight: 600; flex: 0 0 auto;
}
.rz-profile-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Notifications bell ---------- */
.rz-notif-btn { position: relative; }
.rz-notif-badge {
    position: absolute;
    top: -5px;
    inset-inline-end: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--rz-brand);
    color: var(--rz-on-brand, #1D1F20);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.rz-notif-panel {
    width: min(380px, calc(100vw - 24px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--rz-line);
    background: var(--rz-surface);
}
.rz-notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rz-line);
}
.rz-notif-list { max-height: 420px; overflow-y: auto; }
.rz-notif-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--rz-line);
    color: var(--rz-ink);
    text-decoration: none;
}
.rz-notif-item:last-child { border-bottom: 0; }
a.rz-notif-item:hover { background: var(--rz-sunken); color: var(--rz-ink); }
.rz-notif-item.is-unread { box-shadow: inset 3px 0 0 var(--rz-brand); }
[dir="rtl"] .rz-notif-item.is-unread { box-shadow: inset -3px 0 0 var(--rz-brand); }
.rz-notif-title { font-weight: 600; }
.rz-notif-item.is-unread .rz-notif-title { font-weight: 700; }
.rz-notif-body {
    color: var(--rz-muted);
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rz-notif-time { color: var(--rz-muted); font-size: 12px; }
.rz-notif-empty { margin: 0; padding: 24px 16px; text-align: center; color: var(--rz-muted); }
.rz-notif-more { border-top: 1px solid var(--rz-line); border-radius: 0; }

/* ---------- Account pages ---------- */
.rz-narrow-panel { max-width: 520px; }
.user-chip-link { color: inherit; text-decoration: none; }
.user-chip-link:hover { color: inherit; opacity: .85; }

/* ---------- Announcements from the Resaala team (home) ---------- */
.rz-announcement-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rz-announcement-list li { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--rz-line); }
.rz-announcement-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.rz-announcement-body { white-space: pre-line; }
.rz-announcement-time { color: var(--rz-muted); font-size: 12px; }

/* ---------- checkout (campaign + subscription card payment) ---------- */
.rz-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
    max-width: 1080px;
}

.rz-checkout-summary {
    position: sticky;
    top: calc(var(--rz-topbar-height) + 16px);
}

.rz-checkout-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--rz-ink);
}

.rz-checkout-title .bi { color: var(--rz-brand); font-size: 18px; }
.rz-checkout-secure { flex-shrink: 0; }

.rz-checkout-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--rz-muted);
    text-decoration: none;
    white-space: nowrap;
}

.rz-checkout-back:hover { color: var(--rz-brand-text); }
[dir="ltr"] .rz-checkout-back .bi-arrow-right { transform: scaleX(-1); }

.rz-checkout-eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--rz-muted);
}

.rz-checkout-message {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 18px;
    padding: 12px 14px;
    background: var(--rz-sunken);
    border-radius: var(--rz-radius-m);
    border-inline-start: 3px solid var(--rz-brand);
    color: var(--rz-text);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.rz-checkout-lines { display: flex; flex-direction: column; margin: 0; }

.rz-checkout-lines > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px dashed var(--rz-line);
}

.rz-checkout-lines > div:first-child { padding-top: 0; border-top: 0; }
.rz-checkout-lines > div:last-child { padding-bottom: 0; }
.rz-checkout-lines dt { font-size: 14px; font-weight: 400; color: var(--rz-muted); }

.rz-checkout-lines dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--rz-ink);
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.rz-checkout-discount { color: var(--rz-good-fg) !important; }

.rz-checkout-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 24px;
    background: var(--rz-sunken);
    border-top: 1px solid var(--rz-line);
}

.rz-checkout-total-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rz-ink);
}

.rz-checkout-total-label small { font-size: 12px; font-weight: 400; color: var(--rz-muted); }

.rz-checkout-total-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--rz-ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rz-checkout-total-value small {
    margin-inline-start: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rz-muted);
}

.rz-checkout-skeleton { display: flex; flex-direction: column; gap: 10px; }
.rz-checkout-skeleton .rz-skeleton-line { height: 44px; border-radius: 10px; }
.rz-checkout-skeleton-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rz-checkout-card iframe { display: block; width: 100%; border: 0; color-scheme: normal; }

.rz-checkout-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--rz-radius-m);
    background: var(--rz-danger-bg);
    color: var(--rz-danger-fg);
    font-size: 14px;
}

.rz-checkout-error .btn { flex-shrink: 0; margin-inline-start: auto; }
.rz-checkout-status { min-height: 20px; margin: 10px 0 0; font-size: 13px; color: var(--rz-muted); }
.rz-checkout-status:empty { display: none; }

.rz-checkout-pay > .rz-panel-foot { flex-direction: column; align-items: stretch; gap: 10px; }

.rz-checkout-pay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    font-size: 16px;
}

.rz-checkout-powered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    color: var(--rz-muted);
}

@media (max-width: 991.98px) {
    .rz-checkout { grid-template-columns: 1fr; }
    .rz-checkout-summary { position: static; order: -1; }
}
