/*
 * ZE DRIVE admin panel — the parts of the design that Filament has no setting
 * for: the brand block in the sidebar, the dashboard's welcome panel, the
 * import pipeline, and the coloured tile behind each stat card's icon.
 *
 * Every colour is declared twice, once per theme, because the panel is used in
 * both and the prototype was drawn in both. Filament puts `.dark` on <html>,
 * so a single custom property set switches the lot.
 *
 * Deliberately no Tailwind utility classes: Filament ships a compiled stylesheet
 * containing only the utilities its own components use, so an arbitrary one
 * here would silently do nothing.
 */

:root {
    --zd-brand: #2563eb;
    --zd-brand-soft: rgba(37, 99, 235, 0.1);
    --zd-brand-line: rgba(37, 99, 235, 0.22);
    --zd-brand-ink: #1d4ed8;

    --zd-red: #be123c;
    --zd-surface: #ffffff;
    --zd-surface-sunk: #f8fafc;
    --zd-line: #e2e8f0;
    --zd-ink: #0f172a;
    --zd-ink-soft: #475569;
    --zd-ink-faint: #94a3b8;

    --zd-amber: #b45309;
    --zd-amber-soft: rgba(245, 158, 11, 0.12);
    --zd-green: #047857;
    --zd-green-soft: rgba(16, 185, 129, 0.12);
    --zd-rose: #be123c;
    --zd-rose-soft: rgba(244, 63, 94, 0.12);
    --zd-sky: #0369a1;
    --zd-sky-soft: rgba(56, 189, 248, 0.14);
    --zd-slate: #475569;
    --zd-slate-soft: rgba(100, 116, 139, 0.12);
}

.dark {
    --zd-brand: #3b82f6;
    --zd-brand-soft: rgba(59, 130, 246, 0.14);
    --zd-brand-line: rgba(59, 130, 246, 0.3);
    --zd-brand-ink: #93c5fd;

    --zd-red: #fb7185;
    --zd-surface: #0f121a;
    --zd-surface-sunk: #0b0e14;
    --zd-line: #1e2433;
    --zd-ink: #f3f4f6;
    --zd-ink-soft: #94a3b8;
    --zd-ink-faint: #64748b;

    --zd-amber: #fbbf24;
    --zd-amber-soft: rgba(245, 158, 11, 0.16);
    --zd-green: #34d399;
    --zd-green-soft: rgba(16, 185, 129, 0.16);
    --zd-rose: #fb7185;
    --zd-rose-soft: rgba(244, 63, 94, 0.16);
    --zd-sky: #38bdf8;
    --zd-sky-soft: rgba(56, 189, 248, 0.16);
    --zd-slate: #94a3b8;
    --zd-slate-soft: rgba(148, 163, 184, 0.14);
}

/* --- the official logo, in place of Filament's plain wordmark ------------ */

.zd-brand {
    display: inline-flex;
    align-items: center;
}

/* The artwork is white and coloured lettering on black, so it is shown on a
   black plate rather than keyed transparent — see the partial for why. The
   plate is what makes it sit correctly on a white sidebar as well as a dark
   one. */
.zd-brand__logo {
    display: block;
    height: 2.5rem;
    width: auto;
    max-width: 100%;
    border-radius: 0.5rem;
    background: #000;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}

.dark .zd-brand__logo {
    /* On a dark panel the plate and the background are near enough the same
       black that a hard edge would look like a mistake; a hairline separates
       them instead. */
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.14);
}

/* The sign-in card gives it more room than the sidebar does. */
.fi-simple-main .zd-brand__logo {
    height: 4rem;
    margin-inline: auto;
}

.fi-simple-main .zd-brand {
    display: flex;
    justify-content: center;
}

/* --- the dashboard welcome panel ---------------------------------------- */

.zd-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--zd-line);
    background: var(--zd-surface);
    background-image: radial-gradient(
        60% 130% at 100% 0%,
        var(--zd-brand-soft) 0%,
        transparent 70%
    );
}

.zd-hero__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--zd-ink);
    margin: 0;
}

.zd-hero__live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    border: 1px solid var(--zd-brand-line);
    background: var(--zd-brand-soft);
    color: var(--zd-brand-ink);
    font-size: 0.7rem;
    font-weight: 700;
}

.zd-hero__live::before {
    content: '';
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background: currentColor;
}

.zd-hero__lede {
    margin: 0.5rem 0 0;
    max-width: 52ch;
    font-size: 0.8125rem;
    line-height: 1.8;
    color: var(--zd-ink-soft);
}

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

/* --- the import pipeline ------------------------------------------------- */

.zd-pipe {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
}

.zd-pipe__stage {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem;
    border-radius: 0.65rem;
    border: 1px solid var(--zd-line);
    background: var(--zd-surface-sunk);
}

/* The signed-in person's roles, under the greeting. */
.zd-hero__role {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(37 99 235);
    background: rgb(37 99 235 / 0.1);
}

/* A stage opens the car orders at it. */
.zd-pipe__stage--link {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.zd-pipe__stage--link:hover,
.zd-pipe__stage--link:focus-visible {
    border-color: rgb(37 99 235 / 0.55);
    box-shadow: 0 4px 14px rgb(15 23 42 / 0.08);
    transform: translateY(-1px);
    outline: none;
}

/* Stat cards that open their list look and feel clickable. */
a.zd-stat {
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

a.zd-stat:hover,
a.zd-stat:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgb(15 23 42 / 0.10);
    outline: none;
}

.zd-pipe__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.zd-pipe__step {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--zd-ink-faint);
}

.zd-pipe__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: var(--zd-slate-soft);
    color: var(--zd-slate);
}

.zd-pipe__stage[data-accent='brand'] .zd-pipe__count {
    background: var(--zd-brand-soft);
    color: var(--zd-brand-ink);
}

.zd-pipe__stage[data-accent='sky'] .zd-pipe__count {
    background: var(--zd-sky-soft);
    color: var(--zd-sky);
}

.zd-pipe__stage[data-accent='amber'] .zd-pipe__count {
    background: var(--zd-amber-soft);
    color: var(--zd-amber);
}

.zd-pipe__stage[data-accent='green'] .zd-pipe__count {
    background: var(--zd-green-soft);
    color: var(--zd-green);
}

.zd-pipe__label {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--zd-ink);
}

.zd-pipe__bar {
    height: 0.25rem;
    border-radius: 9999px;
    background: var(--zd-line);
    overflow: hidden;
}

.zd-pipe__bar span {
    display: block;
    height: 100%;
    border-radius: 9999px;
    background: var(--zd-slate);
}

.zd-pipe__stage[data-accent='brand'] .zd-pipe__bar span {
    background: var(--zd-brand);
}

.zd-pipe__stage[data-accent='sky'] .zd-pipe__bar span {
    background: var(--zd-sky);
}

.zd-pipe__stage[data-accent='amber'] .zd-pipe__bar span {
    background: var(--zd-amber);
}

.zd-pipe__stage[data-accent='green'] .zd-pipe__bar span {
    background: var(--zd-green);
}

.zd-pipe__empty {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--zd-ink-soft);
}

/* --- stat cards: the prototype's tinted tile behind the icon ------------- */

.zd-stat .fi-wi-stats-overview-stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.5rem;
    flex: none;
    border-radius: 0.6rem;
    background: var(--zd-slate-soft);
    color: var(--zd-slate);
}

.zd-stat[class*='zd-accent-'] .fi-wi-stats-overview-stat-icon {
    /* Filament hard-codes a grey on the icon; this wins on specificity. */
    color: var(--zd-accent);
    background: var(--zd-accent-soft);
}

.zd-accent-brand {
    --zd-accent: var(--zd-brand);
    --zd-accent-soft: var(--zd-brand-soft);
}

.zd-accent-sky {
    --zd-accent: var(--zd-sky);
    --zd-accent-soft: var(--zd-sky-soft);
}

.zd-accent-amber {
    --zd-accent: var(--zd-amber);
    --zd-accent-soft: var(--zd-amber-soft);
}

.zd-accent-green {
    --zd-accent: var(--zd-green);
    --zd-accent-soft: var(--zd-green-soft);
}

.zd-accent-rose {
    --zd-accent: var(--zd-rose);
    --zd-accent-soft: var(--zd-rose-soft);
}

.zd-accent-slate {
    --zd-accent: var(--zd-slate);
    --zd-accent-soft: var(--zd-slate-soft);
}

/* The label sits beside a tile now, so it needs the room. */
.zd-stat .fi-wi-stats-overview-stat-label {
    line-height: 1.4;
}

/* --- sidebar footer ------------------------------------------------------ */

.zd-version {
    padding: 0.75rem 1rem;
    font-size: 0.6875rem;
    color: var(--zd-ink-faint);
    text-align: center;
    border-top: 1px solid var(--zd-line);
}

/* --- the sign-in page ----------------------------------------------------
 *
 * A photograph behind the card, darkened hard. Two layers do the darkening,
 * not one: a flat wash that takes the whole picture down, and a gradient that
 * takes the middle down further, so the card sits on the quietest part of the
 * image and the skyline stays legible around it.
 *
 * Only the sign-in and two-factor pages use Filament's simple layout, so the
 * photograph is fetched on those and nowhere else in the panel.
 */

.fi-simple-layout {
    position: relative;
    background-color: #05070c;
    background-image: url('/images/admin-login.jpg');
    background-size: cover;
    background-position: center;
    /* Fixed, so the picture does not crawl when a short viewport scrolls the
       card — on a phone that reads as the page tearing. */
    background-attachment: fixed;
}

.fi-simple-layout::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(70% 60% at 50% 50%, rgba(3, 6, 12, 0.82) 0%, rgba(3, 6, 12, 0.55) 100%),
        rgba(5, 8, 14, 0.62);
}

/* Everything the layout draws sits above the scrim. */
.fi-simple-layout > * {
    position: relative;
    z-index: 1;
}

/* The card, lifted off the photograph.
 *
 * Kept nearly opaque on purpose: a translucent card over a busy picture is
 * pretty and hard to read, and this is the one page where a person is typing
 * a password they cannot see. */
.fi-simple-main {
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.75);
}

.dark .fi-simple-main {
    background-color: rgba(15, 18, 26, 0.94);
    border-color: rgba(148, 163, 184, 0.18);
}

/* Filament's own ring would draw a second, paler outline over the border. */
.fi-simple-main {
    --tw-ring-color: transparent;
}

/* --- which picture the app will actually show ---------------------------
 *
 * Both ways of giving an image — upload a file, paste a link — sit side by
 * side in the form, and the model prefers the upload. This states the outcome
 * rather than leaving it in a line of helper text.
 */

.zd-source {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.zd-source--upload {
    background: var(--zd-green-soft);
    color: var(--zd-green);
}

.zd-source--url {
    background: var(--zd-brand-soft);
    color: var(--zd-brand-ink);
}

.zd-source-note {
    display: inline-block;
    margin-inline-start: 0.5rem;
    font-size: 0.75rem;
    color: var(--zd-ink-soft);
}

.zd-source-thumb {
    display: block;
    margin-top: 0.5rem;
    height: 5rem;
    width: auto;
    max-width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--zd-line);
    object-fit: cover;
    background: var(--zd-surface-sunk);
}

/* A link that does not resolve. Saying so here is the whole point of the
   preview — the alternative is finding out on a customer's phone. */
.zd-source-thumb.is-broken {
    display: flex;
    height: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--zd-rose);
    border-color: var(--zd-rose);
}

.zd-source-thumb.is-broken::after {
    content: 'تعذّر تحميل الصورة من هذا الرابط';
}

html[lang='en'] .zd-source-thumb.is-broken::after {
    content: "Couldn't load the image from this link";
}


/*
 * Plates — the official template drawn by App\Support\SaudiPlate, and the
 * plate form's template picker. The plate is a photograph of a physical
 * object, so it keeps its own colours in both themes; only the frame around
 * it follows the panel.
 */
.zd-plate {
    width: 100%;
    filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.18));
}

.fi-ta-cell .zd-plate {
    min-width: 160px;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.16));
}

.zd-tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.75rem;
}

.zd-tpl {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.625rem;
    border: 1px solid var(--zd-line);
    border-radius: 0.75rem;
    background: var(--zd-surface-sunk);
    color: var(--zd-ink);
    text-align: start;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.zd-tpl:hover {
    border-color: var(--zd-brand-line);
}

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

.zd-tpl.is-selected {
    border-color: var(--zd-brand);
    background: var(--zd-brand-soft);
    box-shadow: 0 0 0 1px var(--zd-brand);
}

.zd-tpl__plate {
    display: block;
    width: 100%;
    height: 44px;
    object-fit: contain;
}

.zd-tpl__label {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
}

.zd-tpl.is-selected .zd-tpl__label {
    color: var(--zd-brand-ink);
}

.zd-tpl__flag {
    align-self: flex-start;
    padding: 0.0625rem 0.5rem;
    border-radius: 999px;
    background: var(--zd-amber-soft);
    color: var(--zd-amber);
    font-size: 0.6875rem;
    font-weight: 600;
}

/*
 * The brand page (add / edit): a header with the brand's name and status,
 * two cards — the brand, then its models as rows — and a footer with the
 * save and discard actions.
 */
.zd-brand-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--zd-line);
}

.zd-brand-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.zd-brand-heading__title {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--zd-ink);
}

.zd-brand-heading__name {
    color: var(--zd-brand);
}

.zd-brand-status {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--zd-line);
    border-radius: 0.5rem;
    background: var(--zd-slate-soft);
    color: var(--zd-slate);
    font-size: 0.8125rem;
    font-weight: 600;
}

.zd-brand-status.is-on {
    border-color: rgba(16, 185, 129, 0.35);
    background: var(--zd-green-soft);
    color: var(--zd-green);
}

.zd-brand-header__side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.zd-brand-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--zd-line);
    border-radius: 0.75rem;
    background: var(--zd-surface-sunk);
    color: var(--zd-ink-soft);
    font-size: 0.8125rem;
}

.zd-brand-meta strong {
    color: var(--zd-ink);
    font-weight: 700;
}

.zd-brand-meta__dot {
    color: var(--zd-ink-faint);
}

/* The two cards. */
.zd-brand-card {
    border-radius: 1rem;
}

/* The brand card carries an accent on its start edge. */
.zd-brand-card--accent {
    border-inline-start: 3px solid var(--zd-brand);
}

/* Its note about required fields sits across from the heading, not under it. */
.zd-brand-card--accent .fi-section-header .grid.flex-1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.zd-brand-card .fi-section-header {
    border-bottom: 1px solid var(--zd-line);
}

.zd-brand-card .fi-section-header-icon {
    color: var(--zd-brand);
}

.zd-count {
    display: inline-block;
    margin-inline-start: 0.5rem;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: var(--zd-brand-soft);
    color: var(--zd-brand-ink);
    font-size: 0.8125rem;
    font-weight: 700;
    vertical-align: middle;
}

.zd-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.02em;
}

/* The status toggle, set as its own small card. */
.zd-status-card {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1px solid var(--zd-line);
    border-radius: 0.75rem;
    background: var(--zd-surface-sunk);
}

.zd-status-card .fi-fo-field-wrp-label {
    width: 100%;
}

.zd-state {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.3;
}

.zd-state__title {
    font-weight: 700;
    color: var(--zd-ink);
}

.zd-state__sub {
    font-size: 0.75rem;
    color: var(--zd-ink-faint);
}

.zd-state__sub.is-on {
    color: var(--zd-green);
}

.zd-add-model {
    border-color: var(--zd-brand-line) !important;
    color: var(--zd-brand-ink) !important;
    background: var(--zd-brand-soft) !important;
}

/* The model rows. */
.zd-model-rows__list {
    display: grid;
    gap: 0.875rem;
}

.zd-model-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--zd-line);
    border-radius: 0.875rem;
    background: var(--zd-surface-sunk);
    transition: border-color 120ms ease;
}

.zd-model-row:hover {
    border-color: var(--zd-brand-line);
}

.zd-model-row__lead {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.zd-model-row__handle {
    cursor: grab;
    color: var(--zd-ink-faint);
}

.zd-model-row__number {
    min-width: 2.25rem;
    padding: 0.2rem 0.45rem;
    border-radius: 0.4rem;
    background: var(--zd-slate-soft);
    color: var(--zd-ink-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    text-align: center;
}

.zd-model-row__fields {
    flex: 1;
    min-width: 0;
}

.zd-model-row__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.zd-model-row__delete .fi-icon-btn {
    color: var(--zd-rose);
}

/* The year range reads as one field: from – to. */
.zd-year--to .fi-fo-field-wrp-label {
    visibility: hidden;
}

.zd-year--from {
    position: relative;
}

.zd-year--from::after {
    content: '–';
    position: absolute;
    inset-inline-end: -0.85rem;
    bottom: 0.55rem;
    color: var(--zd-ink-faint);
}

.zd-year input {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* The row's switch sits as a pill, level with the inputs. */
.zd-model-toggle {
    align-self: end;
    display: inline-flex;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--zd-line);
    border-radius: 0.75rem;
    background: var(--zd-surface);
}

.zd-model-rows__add {
    margin-top: 0.875rem;
}

.zd-model-rows__add .fi-btn,
.zd-model-rows__add button {
    width: 100%;
    justify-content: center;
    padding-block: 0.9rem;
    border: 1.5px dashed var(--zd-line) !important;
    border-radius: 0.875rem;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--zd-ink-soft) !important;
}

.zd-model-rows__add .fi-btn:hover,
.zd-model-rows__add button:hover {
    border-color: var(--zd-brand-line) !important;
    color: var(--zd-brand-ink) !important;
}

.zd-model-rows__empty {
    padding: 1.25rem;
    border-radius: 0.875rem;
    background: var(--zd-surface-sunk);
    color: var(--zd-ink-faint);
    text-align: center;
    font-size: 0.875rem;
}

/* The footer: the actions on the end side. */
.zd-form-footer {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 767px) {
    .zd-model-row {
        flex-wrap: wrap;
    }

    .zd-model-row__fields {
        flex-basis: 100%;
        order: 3;
    }

    .zd-model-row__actions {
        margin-inline-start: auto;
    }
}

.zd-state__sub {
    white-space: nowrap;
}

/*
 * Lists — every table in the panel, after the brands list reference: a title
 * with a count pill, a glowing «إضافة» button, the table as one rounded card
 * with the search on the start side, roomy rows, counts in small boxes, yes/no
 * as a tick or cross in a ring, «تعديل | حذف» as words, and a footer with the
 * total and worded paging. Colours come from the tokens above, so both themes
 * follow.
 */

/* Title and count. */
.zd-list-title {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.zd-list-count {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.75rem;
    border: 1px solid var(--zd-brand-line);
    border-radius: 999px;
    background: var(--zd-brand-soft);
    color: var(--zd-brand-ink);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.6;
}

.fi-resource-list-records-page .fi-header-heading {
    font-size: 2rem;
    font-weight: 800;
}

/* The page's primary action lifts off the page. */
.fi-header .fi-ac .fi-btn.fi-color-primary {
    padding-inline: 1.25rem;
    border-radius: 0.75rem;
    background-image: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 10px 24px -8px rgba(37, 99, 235, 0.6);
}

/* The table as one card. */
.fi-ta-ctn {
    border-radius: 1rem !important;
    border: 1px solid var(--zd-line);
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    overflow: hidden;
}

/* Search on the start side, the table's own buttons on the end. */
.fi-ta-header-toolbar {
    flex-direction: row-reverse;
    padding: 1.25rem 1.5rem !important;
}

.fi-ta-header-toolbar > :last-child {
    flex: 1;
    justify-content: flex-start;
}

.fi-ta-search-field {
    flex: 1;
    max-width: 38rem;
}

.fi-ta-search-field .fi-input-wrp {
    min-height: 3rem;
    border-radius: 0.75rem;
}

.fi-ta-header-toolbar .fi-icon-btn,
.fi-ta-header-toolbar .fi-ta-reorder-trigger {
    min-width: 3rem;
    min-height: 3rem;
    border: 1px solid var(--zd-line);
    border-radius: 0.75rem;
}

/* Headings and rows. */
.fi-ta-table thead tr {
    background: var(--zd-surface-sunk);
}

.fi-ta-header-cell {
    padding-block: 1.1rem !important;
}

.fi-ta-header-cell-label,
.fi-ta-actions-header-cell::before {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--zd-ink-soft);
}

/* The actions column has no visible heading; give it one. */
.fi-ta-actions-header-cell::before {
    content: 'الإجراءات';
    display: block;
    padding-inline: 1.5rem;
    white-space: nowrap;
    text-align: start;
}

html[lang='en'] .fi-ta-actions-header-cell::before {
    content: 'Actions';
}

.fi-ta-row:hover {
    background: var(--zd-surface-sunk);
}

/* A count in a box. */
.zd-num .fi-ta-text-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding-inline: 0.6rem;
    border: 1px solid var(--zd-line);
    border-radius: 0.6rem;
    background: var(--zd-surface-sunk);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Yes / no in a ring. */
.fi-ta-icon .fi-ta-icon-item {
    box-sizing: content-box;
    width: 1.1rem !important;
    height: 1.1rem !important;
    padding: 0.55rem;
    border-radius: 999px;
    border: 1.5px solid currentColor;
}

.fi-ta-icon .fi-ta-icon-item.fi-color-success {
    background: var(--zd-green-soft);
    border-color: rgba(16, 185, 129, 0.45);
}

.fi-ta-icon .fi-ta-icon-item.fi-color-danger {
    background: var(--zd-rose-soft);
    border-color: rgba(244, 63, 94, 0.45);
}

/* «تعديل | حذف»: the actions as words, divided by a rule. */
.fi-ta-actions {
    gap: 0 !important;
    padding-inline: 1.5rem;
}

:lang(en) .fi-ta-actions-header-cell::before {
    content: 'Actions';
}

.fi-ta-actions > * + * {
    position: relative;
    margin-inline-start: 1.7rem;
}

.fi-ta-actions > * + *::before {
    content: '';
    position: absolute;
    inset-inline-start: -0.85rem;
    top: 50%;
    width: 1px;
    height: 1rem;
    transform: translateY(-50%);
    background: var(--zd-ink-faint);
    opacity: 0.6;
}

.fi-ta-actions .fi-link {
    font-size: 0.9rem;
}

/* Footer. */
.fi-ta-ctn > div:last-child .fi-pagination,
.fi-ta-pagination {
    padding: 1.1rem 1.5rem;
}

.zd-pagination-overview {
    color: var(--zd-ink-soft) !important;
    font-weight: 500 !important;
}

.zd-pagination-overview strong {
    color: var(--zd-ink);
    font-weight: 700;
}

.zd-pagination-items {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none !important;
    box-shadow: none !important;
}

.zd-page-btn {
    min-width: 2.5rem;
    height: 2.5rem;
    padding-inline: 0.9rem;
    border: 1px solid var(--zd-line);
    border-radius: 0.6rem;
    background: var(--zd-surface-sunk);
    color: var(--zd-ink-soft);
    font-size: 0.875rem;
    font-weight: 600;
    transition: border-color 120ms ease, color 120ms ease;
}

.zd-page-btn:not(:disabled):not(.is-current):hover {
    border-color: var(--zd-brand-line);
    color: var(--zd-brand-ink);
}

.zd-page-btn:disabled,
.zd-page-btn.is-gap {
    opacity: 0.5;
    cursor: default;
}

.zd-page-num {
    padding-inline: 0;
}

.zd-page-btn.is-current {
    border-color: transparent;
    background: var(--zd-brand);
    color: #fff;
    box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.7);
}

@media (max-width: 639px) {
    .fi-ta-header-toolbar {
        flex-wrap: wrap;
        padding: 1rem !important;
    }

    .fi-ta-search-field {
        max-width: none;
    }

    .fi-ta-actions {
        padding-inline: 0.75rem;
    }
}

/* ------------------------------------------------------------------------
   Two-step sign-in: a card on its own (App\Filament\Pages\TwoFactorChallenge
   renders on Filament's bare layout). Always dark — it is a gate, shown
   between the sign-in form and the panel, whichever theme the panel uses.
   ------------------------------------------------------------------------ */
.zd-2fa {
    --zd2-ink: #f4f6fb;
    --zd2-muted: #9aa3b5;
    --zd2-line: rgba(255, 255, 255, 0.08);
    --zd2-box: #0f1420;
    --zd2-box-line: #283042;
    --zd2-blue: #3b6cf0;
    --zd2-blue-soft: rgba(59, 108, 240, 0.35);
    --zd2-green: #4ade80;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    color: var(--zd2-ink);
    background:
        radial-gradient(60% 45% at 50% 30%, rgba(40, 70, 160, 0.14), transparent 70%),
        #030406;
    color-scheme: dark;
}
.zd-2fa [x-cloak] { display: none !important; }
.zd-2fa__logout { display: none; }

.zd-2fa__card {
    position: relative;
    width: 100%;
    max-width: 540px;
    padding: 36px 36px 0;
    border: 1px solid var(--zd2-line);
    border-radius: 20px;
    background:
        radial-gradient(70% 38% at 50% 0%, rgba(59, 108, 240, 0.16), transparent 72%),
        linear-gradient(180deg, #0f1420 0%, #0a0e16 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    text-align: center;
    overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
    .zd-2fa__card { animation: zd-2fa-in 0.28s ease-out both; }
}
@keyframes zd-2fa-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }

.zd-2fa__close {
    position: absolute;
    top: 18px;
    inset-inline-end: 18px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--zd2-muted);
    background: transparent;
}
.zd-2fa__close:hover { color: var(--zd2-ink); background: rgba(255, 255, 255, 0.06); }

.zd-2fa__badge {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    margin: 0 auto 22px;
    border-radius: 18px;
    color: #8fb0ff;
    border: 1px solid rgba(96, 140, 255, 0.35);
    background: linear-gradient(180deg, rgba(59, 108, 240, 0.28), rgba(59, 108, 240, 0.08));
    box-shadow: 0 0 36px rgba(59, 108, 240, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.zd-2fa__title { margin: 0; font-size: 1.75rem; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
.zd-2fa__lede { margin: 10px auto 0; max-width: 42ch; font-size: 0.95rem; line-height: 1.7; color: #c9cfdb; }

.zd-2fa__form { display: grid; gap: 18px; margin-top: 32px; text-align: start; }

.zd-2fa__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.zd-2fa__label { font-size: 0.85rem; font-weight: 600; color: #d5dae4; }
.zd-2fa__pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--zd2-green);
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.22);
}
.zd-2fa__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.zd-2fa__pill.is-ending { color: #fbbf24; background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.25); }

.zd-2fa__boxes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 10px;
}
.zd-2fa__dash { color: #5b6477; font-size: 1.1rem; padding-inline: 6px; }
.zd-2fa__box,
.zd-2fa__recovery {
    width: 100%;
    color: var(--zd2-ink);
    background: var(--zd2-box);
    border: 1px solid var(--zd2-box-line);
    border-radius: 12px;
    font: 600 1.5rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
    text-align: center;
    caret-color: var(--zd2-blue);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.zd-2fa__box { aspect-ratio: 1 / 1; max-height: 64px; padding: 0; }
.zd-2fa__recovery { height: 56px; margin-top: 10px; font-size: 1.1rem; letter-spacing: 0.08em; }
.zd-2fa__box:focus,
.zd-2fa__recovery:focus {
    outline: none;
    border-color: var(--zd2-blue);
    box-shadow: 0 0 0 3px var(--zd2-blue-soft);
}

.zd-2fa__error { margin: 0; font-size: 0.88rem; color: #f87171; text-align: center; }

.zd-2fa__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    margin-top: 6px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #4577f5, #3563e3);
    box-shadow: 0 10px 28px rgba(53, 99, 227, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: filter 0.15s, opacity 0.15s;
}
.zd-2fa__submit:hover { filter: brightness(1.08); }
.zd-2fa__submit:disabled { opacity: 0.6; cursor: progress; }
[dir='rtl'] .zd-2fa__arrow { transform: scaleX(-1); }

.zd-2fa__links { display: grid; justify-items: center; gap: 6px; }
.zd-2fa__link { font-size: 0.86rem; font-weight: 600; color: var(--zd2-muted); padding: 4px 8px; border-radius: 6px; }
.zd-2fa__link:hover { color: var(--zd2-ink); }

.zd-2fa__close:focus-visible,
.zd-2fa__submit:focus-visible,
.zd-2fa__link:focus-visible { outline: 2px solid #8fb0ff; outline-offset: 2px; }

.zd-2fa__foot {
    margin: 28px -36px 0;
    padding: 16px 36px;
    border-top: 1px solid var(--zd2-line);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.8rem;
    color: #7c8597;
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    .zd-2fa__card { padding: 30px 20px 0; }
    .zd-2fa__foot { margin-inline: -20px; padding-inline: 20px; }
    .zd-2fa__boxes { gap: 6px; }
    .zd-2fa__dash { padding-inline: 0; }
    .zd-2fa__box { font-size: 1.25rem; border-radius: 10px; }
}

/* ------------------------------------------------------------------------
   Two-factor setup page (App\Filament\Pages\TwoFactor): QR code or typed
   key, then a code to confirm. Light and dark follow the panel's theme.
   ------------------------------------------------------------------------ */
.zd-tfa {
    --t-card: #ffffff;
    --t-head: #f6f8fc;
    --t-line: rgb(var(--gray-200));
    --t-ink: rgb(var(--gray-950));
    --t-soft: rgb(var(--gray-600));
    --t-muted: rgb(var(--gray-500));
    --t-field: #f3f5f9;
    --t-field-line: rgb(var(--gray-200));
    --t-blue: #2f63e8;
    --t-blue-ink: #2554cf;
    --t-blue-soft: rgba(47, 99, 232, 0.1);
    --t-blue-line: rgba(47, 99, 232, 0.3);
    --t-warn: #d97706;
    display: grid;
    gap: 20px;
}
.dark .zd-tfa {
    --t-card: linear-gradient(180deg, #0f1522 0%, #0b1019 100%);
    --t-head: rgba(59, 108, 240, 0.06);
    --t-line: rgba(255, 255, 255, 0.08);
    --t-ink: #f2f5fb;
    --t-soft: #c3cad8;
    --t-muted: #8791a3;
    --t-field: #0a0e16;
    --t-field-line: rgba(255, 255, 255, 0.08);
    --t-blue: #3b6cf0;
    --t-blue-ink: #8fb0ff;
    --t-blue-soft: rgba(59, 108, 240, 0.12);
    --t-blue-line: rgba(96, 140, 255, 0.35);
    --t-warn: #fbbf24;
}

.zd-tfa__card {
    background: var(--t-card);
    border: 1px solid var(--t-line);
    border-radius: 20px;
    overflow: hidden;
    color: var(--t-ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dark .zd-tfa__card { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }

.zd-tfa__head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 26px;
    background: var(--t-head);
    border-bottom: 1px solid var(--t-line);
}
.zd-tfa__badge {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    color: var(--t-blue-ink);
    background: var(--t-blue-soft);
    border: 1px solid var(--t-blue-line);
}
.zd-tfa__badge.is-ok { color: #16a34a; background: rgba(22, 163, 74, 0.1); border-color: rgba(22, 163, 74, 0.3); }
.dark .zd-tfa__badge.is-ok { color: #4ade80; }
.zd-tfa__title { margin: 0; font-size: 1.2rem; font-weight: 800; line-height: 1.4; }
.zd-tfa__sub { margin: 4px 0 0; font-size: 0.9rem; line-height: 1.7; color: var(--t-soft); }

.zd-tfa__body { display: grid; gap: 22px; padding: 26px; }
.zd-tfa__narrow { max-width: 460px; }

.zd-tfa__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .zd-tfa__grid { grid-template-columns: minmax(0, 1fr); } }

.zd-tfa__qrpanel {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--t-blue-line);
    border-radius: 18px;
    background: var(--t-blue-soft);
}
.zd-tfa__option { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; font-size: 0.95rem; }
.zd-tfa__option svg { color: var(--t-blue-ink); }
.zd-tfa__qr {
    position: relative;
    width: 100%;
    max-width: 260px;
    padding: 12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.zd-tfa__qr svg { display: block; width: 100%; height: auto; }
.zd-tfa__qrmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 17%;
    aspect-ratio: 1;
    border-radius: 8px;
    background: #2f63e8;
    color: #fff;
    font: 800 clamp(14px, 3vw, 22px)/1 var(--font-family, inherit);
    box-shadow: 0 0 0 4px #fff;
}
.zd-tfa__hint { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.85rem; color: var(--t-soft); }
.zd-tfa__hint svg { color: var(--t-blue-ink); flex: none; }

.zd-tfa__fields { display: grid; gap: 20px; }
.zd-tfa__field { display: grid; gap: 8px; }
.zd-tfa__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.zd-tfa__label { font-size: 0.9rem; font-weight: 700; color: var(--t-ink); }
.zd-tfa__req { color: #ef4444; }
.zd-tfa__muted { font-size: 0.8rem; color: var(--t-muted); }

.zd-tfa__key {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    padding-inline-start: 16px;
    background: var(--t-field);
    border: 1px solid var(--t-field-line);
    border-radius: 12px;
}
.zd-tfa__key code {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    font: 500 1rem/1.6 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    letter-spacing: 0.12em;
    color: var(--t-ink);
    user-select: all;
    scrollbar-width: none;
}
.zd-tfa__copy,
.zd-tfa__ghost {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--t-ink);
    background: var(--t-card);
    border: 1px solid var(--t-line);
}
.dark .zd-tfa__copy, .dark .zd-tfa__ghost { background: rgba(255, 255, 255, 0.05); }
.zd-tfa__copy svg, .zd-tfa__ghost svg { color: var(--t-blue-ink); }
.zd-tfa__copy:hover, .zd-tfa__ghost:hover { border-color: var(--t-blue-line); }

.zd-tfa__uri,
.zd-tfa__code {
    width: 100%;
    color: var(--t-ink);
    background: var(--t-field);
    border: 1px solid var(--t-field-line);
    border-radius: 12px;
}
.zd-tfa__uri { padding: 12px 14px; font: 0.78rem/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--t-soft); }
.zd-tfa__code {
    height: 64px;
    text-align: center;
    font: 600 1.6rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    letter-spacing: 0.35em;
}
.zd-tfa__code::placeholder { color: var(--t-muted); opacity: 0.55; }
.zd-tfa__uri:focus, .zd-tfa__code:focus { outline: none; border-color: var(--t-blue); box-shadow: 0 0 0 3px var(--t-blue-soft); }

.zd-tfa__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.zd-tfa__actions.is-split { justify-content: space-between; }
.zd-tfa__primary,
.zd-tfa__danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 200px;
    height: 50px;
    padding: 0 24px;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 700;
    color: #fff;
}
.zd-tfa__primary { background: linear-gradient(180deg, #4577f5, #3563e3); box-shadow: 0 10px 26px rgba(53, 99, 227, 0.3); }
.zd-tfa__danger { background: #dc2626; }
.zd-tfa__primary:hover, .zd-tfa__danger:hover { filter: brightness(1.07); }
.zd-tfa__link { font-size: 0.9rem; font-weight: 600; color: var(--t-soft); padding: 8px 10px; border-radius: 8px; }
.zd-tfa__link:hover { color: var(--t-ink); }

.zd-tfa__notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-top: 22px; border-top: 1px solid var(--t-line); }
@media (max-width: 900px) { .zd-tfa__notes { grid-template-columns: minmax(0, 1fr); } }
.zd-tfa__note { padding: 18px 20px; border: 1px solid var(--t-line); border-radius: 14px; background: var(--t-head); }
.zd-tfa__note p { margin: 0; font-size: 0.86rem; line-height: 1.8; color: var(--t-soft); }
.zd-tfa__note .zd-tfa__notetitle { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 700; color: var(--t-ink); }
.zd-tfa__notetitle svg { color: var(--t-blue-ink); flex: none; }
.zd-tfa__note.is-warn .zd-tfa__notetitle svg { color: var(--t-warn); }

.zd-tfa__codes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .zd-tfa__codes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.zd-tfa__codes span {
    padding: 10px 12px;
    text-align: center;
    border-radius: 10px;
    background: var(--t-field);
    border: 1px solid var(--t-field-line);
    font: 500 0.95rem/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    user-select: all;
}

.zd-tfa button:focus-visible { outline: 2px solid var(--t-blue); outline-offset: 2px; }

/* --- a picked value stays on one line ------------------------------------ *
 * Filament shrinks the selected value of a searchable select to fit and lets
 * it break anywhere, so in a dialog «7. تم الشحن» came out as «7. تم» over
 * «الشحن» with the field half empty. The value takes the field's width and
 * keeps to one line; a name too long for it ends in an ellipsis. */
.fi-fo-select .choices__list--single {
    display: block;
    width: 100%;
}

.fi-fo-select .choices__list--single .choices__item {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
}

/* --- dashboard: every row of cards fills its width ----------------------- *
 * Filament lays stat cards on a fixed 3- or 4-column grid, so a group of two
 * or five left holes. Here a group of up to four sits on one row; five or
 * six make rows of three; more make rows of four — the last row's cards
 * widen to close the gap. One column on a phone. */
.fi-wi-stats-overview-stats-ctn {
    display: flex !important;
    flex-wrap: wrap;
    gap: 1rem !important;
}

.fi-wi-stats-overview-stats-ctn > * {
    flex: 1 1 0;
    min-width: 0;
}

.fi-wi-stats-overview-stats-ctn:has(> :nth-child(5)) > * {
    flex: 1 1 calc((100% - 2rem) / 3);
}

.fi-wi-stats-overview-stats-ctn:has(> :nth-child(7)) > * {
    flex: 1 1 calc((100% - 3rem) / 4);
}

@media (max-width: 767px) {
    .fi-wi-stats-overview-stats-ctn > *,
    .fi-wi-stats-overview-stats-ctn:has(> :nth-child(5)) > *,
    .fi-wi-stats-overview-stats-ctn:has(> :nth-child(7)) > * {
        flex-basis: 100%;
    }
}

/* Every group of cards opens with a heading of the same size and spacing. */
.fi-wi-stats-overview-header-heading {
    font-size: 1rem;
}

/* --- dashboard: «بانتظار إجراء» as tiles ---------------------------------- */
.zd-pending {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.zd-pending__item {
    flex: 1 1 0;
    min-width: 14rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(var(--gray-200), 1);
    background: rgba(var(--gray-50), 0.6);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Up to four tiles share one row; more break into even rows of three or four. */
.zd-pending:has(> :nth-child(5)) > .zd-pending__item {
    flex-basis: calc((100% - 1.5rem) / 3);
}

.zd-pending:has(> :nth-child(7)) > .zd-pending__item {
    flex-basis: calc((100% - 2.25rem) / 4);
}

.dark .zd-pending__item {
    border-color: rgb(255 255 255 / 0.08);
    background: rgb(255 255 255 / 0.03);
}

.zd-pending__item:hover,
.zd-pending__item:focus-visible {
    border-color: rgba(var(--primary-500), 0.5);
}

.zd-pending__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6rem;
    color: var(--zd-tone, rgba(var(--gray-500), 1));
    background: color-mix(in srgb, var(--zd-tone, rgb(107 114 128)) 14%, transparent);
}

.zd-pending__label {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
}

.zd-pending__count {
    flex: none;
    min-width: 2.25rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: var(--zd-tone, rgba(var(--gray-500), 1));
    background: color-mix(in srgb, var(--zd-tone, rgb(107 114 128)) 14%, transparent);
}

.zd-pending__item[data-tone='danger'] { --zd-tone: rgb(239 68 68); }
.zd-pending__item[data-tone='warning'] { --zd-tone: rgb(245 158 11); }
.zd-pending__item[data-tone='info'] { --zd-tone: rgb(96 165 250); }

.zd-pending__empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgb(34 197 94);
}

@media (max-width: 767px) {
    .zd-pending > .zd-pending__item,
    .zd-pending:has(> :nth-child(5)) > .zd-pending__item,
    .zd-pending:has(> :nth-child(7)) > .zd-pending__item {
        flex-basis: 100%;
        min-width: 0;
    }
}

/* A row that needs someone: an invoice whose transfer receipt is waiting to
   be checked. Amber once a member of staff has opened the receipt, red while
   nobody has (InvoiceResource::table, recordClasses). The edge sits at the
   start of the row — the right in Arabic, the left in English. */
.fi-ta-row.zd-row-attention {
    background: rgb(245 158 11 / 0.07);
}

.fi-ta-row.zd-row-attention > td:first-child {
    box-shadow: inset 3px 0 0 rgb(245 158 11);
}

[dir='rtl'] .fi-ta-row.zd-row-attention > td:first-child {
    box-shadow: inset -3px 0 0 rgb(245 158 11);
}

.fi-ta-row.zd-row-attention--new {
    background: rgb(239 68 68 / 0.08);
}

.fi-ta-row.zd-row-attention--new > td:first-child {
    box-shadow: inset 3px 0 0 rgb(239 68 68);
}

[dir='rtl'] .fi-ta-row.zd-row-attention--new > td:first-child {
    box-shadow: inset -3px 0 0 rgb(239 68 68);
}

.dark .fi-ta-row.zd-row-attention {
    background: rgb(245 158 11 / 0.1);
}

.dark .fi-ta-row.zd-row-attention--new {
    background: rgb(239 68 68 / 0.12);
}
