@font-face {
    font-family: 'Cairo';
    src: url('fonts/Cairo-VariableFont.ttf') format('truetype-variations');
    font-weight: 200 1000;
    font-style: normal;
}

/* Calibri = the desktop app's font (DesignSystem.Fonts). Installed with Windows/Office and not licensed for web embedding,
   so phones and Macs fall back to Segoe UI / Cairo at the same sizes. */
html, body {
    font-family: Calibri, 'Segoe UI', 'Cairo', Tahoma, sans-serif;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "حدث خطأ غير متوقع."
    }

/* ── The web app (Components/Layout/PortalLayout.razor) ──
   Palette = EtmamTheme.PortalTheme. Identity v2 (2026-11-03, the professional redesign starting with the home page): midnight
   navy for the shell and card headers, steel blue for actions and links, Etmam gold for "you are here" and brand touches (the logo
   yellow stays in the logo), violet reserved for what the AI writes, a cool light ground under white cards. One colour per request
   stage (SubmittalStatus.Tones), used the same way in chips, stage tracks, bars and legends. */
.p-shell {
    --p-bg: #F4F6FA;
    --p-surface: #FFFFFF;
    --p-line: #E2E8F0;
    --p-line-soft: #EEF2F7;
    --p-ink: #0F172A;
    --p-text: #334155;
    --p-muted: #64748B;
    --p-primary: #0B1F3A;       /* midnight navy: headings, card headers, figures */
    --p-primary-soft: #E7EDF5;
    --p-action: #1E4E8C;        /* steel blue: buttons, links, progress */
    --p-action-soft: #E6EEF8;
    --p-accent: #C9A24E;        /* Etmam gold: the active item, brand touches */
    --p-accent-dark: #8C6A1F;   /* the gold darkened for text and codes on white (readable) */
    --p-accent-soft: #F7EFDD;
    --p-accent-ink: #0B1F3A;    /* text on the gold */
    --p-ai: #5B4CDB;            /* violet: only what the AI (Claude) writes */
    --p-ai-soft: #EEEDFE;
    --p-ai-ink: #3C3489;
    --p-nav: #0B1F3A;
    --p-nav-ink: #CBD5E1;
    --p-radius: 10px;
    --p-shadow: 0 2px 6px -4px rgba(10, 27, 54, .25);

    /* stage tones: [bg, fg, solid] */
    --t-draft-bg: #F2F4F7;      --t-draft-fg: #475467;      --t-draft: #98A2B3;
    --t-review-bg: #EFF4FF;     --t-review-fg: #1849A9;     --t-review: #2E6BE6;
    --t-consultant-bg: #FFF6E5; --t-consultant-fg: #93370D; --t-consultant: #E59A1A;
    --t-approved-bg: #E7F6EE;   --t-approved-fg: #05603A;   --t-approved: #12A05C;
    --t-revise-bg: #FFF0E6;     --t-revise-fg: #9C2A10;     --t-revise: #EF6820;
    --t-rejected-bg: #FDECEC;   --t-rejected-fg: #912018;   --t-rejected: #D92D20;
    --t-neutral-bg: #F2F4F7;    --t-neutral-fg: #667085;    --t-neutral: #C0C6D0;

    background: var(--p-bg);
    color: var(--p-text);
    font-size: 15.5px;
}

/* ── shell: night-navy sidebar on the start (right) side, white top bar with search, alerts and the user ── */
.p-topbar.mud-appbar {
    background: var(--p-surface) !important; color: var(--p-ink) !important;
    border-bottom: 1px solid var(--p-line); height: 64px; box-shadow: none;
}
.p-topbar .mud-toolbar { height: 64px; min-height: 64px; gap: 10px; }
.p-search-trigger {
    display: flex; align-items: center; gap: 8px; width: min(460px, 100%); height: 40px; padding: 0 12px; cursor: pointer;
    border: 1px solid var(--p-line); border-radius: 10px; background: #F8FAFC; color: var(--p-muted); font: inherit; font-size: 14px;
    text-align: start; transition: border-color .15s, background .15s;
}
.p-search-trigger:hover { border-color: #C8D1DD; background: var(--p-surface); }
.p-search-trigger:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 1px; }
.p-search-trigger .label { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-search-trigger kbd {
    font-family: Consolas, monospace; font-size: 11px; border: 1px solid var(--p-line); border-radius: 4px; padding: 0 5px;
    background: var(--p-surface); color: var(--p-muted); direction: ltr;
}
@media (max-width: 700px) { .p-search-trigger { width: 40px; padding: 0; justify-content: center; } .p-search-trigger .label, .p-search-trigger kbd { display: none; } }
/* NAVORG: the current project and «الأدوات» in the top bar (ProjectPicker, ToolsMenu) */
.p-proj, .p-tools { position: relative; flex-shrink: 0; margin-inline-end: 8px; }
.p-proj-btn, .p-tools-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; cursor: pointer; border: 1px solid var(--p-line); border-radius: 10px;
    background: var(--p-primary-soft); color: var(--p-primary); font: inherit; font-size: 14px; font-weight: 700; max-width: 320px; }
.p-proj-btn.none { background: #F8FAFC; color: var(--p-muted); font-weight: 600; }
.p-proj-btn:hover, .p-tools-btn:hover { border-color: var(--p-primary); }
.p-tools-btn { background: #F8FAFC; color: var(--p-ink); }
.p-proj-text { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.p-proj-text .code { direction: ltr; font-size: 12.5px; color: var(--p-muted); white-space: nowrap; }
.p-proj-text .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-proj-backdrop { position: fixed; inset: 0; z-index: 1300; }
.p-proj-pop, .p-tools-pop { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 1301; background: var(--p-surface); border: 1px solid var(--p-line);
    border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 42, 79, .18); }
.p-proj-pop { width: 380px; padding: 10px; }
.p-proj-search { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border: 1px solid var(--p-line); border-radius: 9px; color: var(--p-muted); }
.p-proj-search input { flex: 1; border: none; outline: none; font: inherit; font-size: 14px; background: transparent; color: var(--p-ink); }
.p-proj-actions { display: flex; gap: 8px; margin: 8px 0 4px; }
.p-proj-actions a, .p-proj-actions button { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px solid var(--p-line); border-radius: 8px;
    background: #F8FAFC; color: var(--p-primary); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.p-proj-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 360px; overflow-y: auto; }
.p-proj-list button { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 8px 10px; border: none; border-radius: 8px; background: none; cursor: pointer;
    font: inherit; font-size: 14px; color: var(--p-ink); text-align: start; }
.p-proj-list button:hover { background: var(--p-line-soft); }
.p-proj-list button.on { background: var(--p-primary-soft); font-weight: 700; }
.p-proj-list .code { direction: ltr; min-width: 64px; font-size: 12.5px; color: var(--p-muted); }
.p-proj-list .name { flex: 1; }
.p-tools-pop { position: fixed; top: 62px; inset-inline-start: 288px; width: min(980px, calc(100vw - 304px)); max-height: calc(100vh - 80px); overflow-y: auto; padding: 14px 16px; }
.p-shell.rail .p-tools-pop { inset-inline-start: 88px; width: min(1100px, calc(100vw - 104px)); }
.p-tools-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--p-line); }
.p-tools-head > a { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--p-primary); font-weight: 700; text-decoration: none; }
.p-tools-grid { columns: 4 200px; column-gap: 22px; }
.p-tools-grid section { break-inside: avoid; margin-bottom: 14px; }
.p-tools-grid h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 13.5px; color: var(--p-primary); }
.p-tools-grid ul { list-style: none; margin: 0; padding: 0; }
.p-tools-grid li { padding: 3px 0; }
.p-tools-grid li > a { color: var(--p-ink); font-size: 14px; text-decoration: none; }
.p-tools-grid a:hover { color: var(--p-primary); text-decoration: underline; }
.p-tools-grid .subs { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 1px; }
.p-tools-grid .subs a { font-size: 12.5px; color: var(--p-muted); text-decoration: none; }
@media (max-width: 900px) { .p-proj-btn { max-width: 160px; } .p-tools-btn span, .p-proj-text .code { display: none; } .p-tools-pop { width: calc(100vw - 32px); position: fixed; top: 64px; inset-inline-start: 16px; } }
.p-top-icons { display: flex; align-items: center; gap: 4px; }
.p-icon-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #3B4A60; text-decoration: none; }
.p-icon-btn:hover { background: var(--p-line-soft); }
.p-icon-btn:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 1px; }
.p-icon-btn .p-badge {
    position: absolute; top: 3px; inset-inline-end: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    display: grid; place-items: center; background: #E04848; color: #FFFFFF; font-size: 11px; font-weight: 700; border: 2px solid var(--p-surface);
}
.p-user {
    display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 6px; margin-inline-start: 6px; border-radius: 10px; cursor: pointer;
    border: none; background: none; font: inherit; color: inherit; border-inline-start: 1px solid var(--p-line);
}
.p-user:hover { background: var(--p-line-soft); }
.p-user-avatar {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: linear-gradient(135deg, #1B3D6B, var(--p-nav)); color: var(--p-accent); font-weight: 700; font-size: 16px;
    border: 2px solid var(--p-accent-soft);
}
.p-user-text { display: flex; flex-direction: column; line-height: 1.25; text-align: start; }
.p-user-text .name { font-weight: 700; color: var(--p-ink); font-size: 15px; }
.p-user-text .role { font-size: 12.5px; color: var(--p-muted); }
@media (max-width: 700px) { .p-user-text { display: none; } .p-user { border: none; padding: 4px; } }

.p-sidebar.mud-drawer { background: var(--p-nav) !important; color: var(--p-nav-ink); border: none; }
.p-sidebar .mud-drawer-content { display: flex; flex-direction: column; padding: 0 12px 16px; gap: 16px; height: 100%; }
.p-brand {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 22px 6px 18px; margin: 0 -12px;
    text-decoration: none; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.p-brand-logo { display: block; width: 150px; height: auto; }
.p-brand-sub { margin-top: 6px; color: #A9B7CB; font-size: 12.5px; line-height: 1.4; }

.p-new-menu { width: 100%; }
.p-new-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px;
    border: 1px solid rgba(201, 162, 78, .55); border-radius: 9px; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px;
    background: rgba(201, 162, 78, .1); color: var(--p-accent); transition: background .15s;
}
.p-new-btn:hover { background: rgba(201, 162, 78, .2); }
.p-new-btn:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }

.p-nav { display: flex; flex-direction: column; gap: 3px; }
.p-nav-section { font-size: 12px; font-weight: 700; color: #7F90A9; padding: 14px 12px 4px; letter-spacing: .2px; }
.p-nav-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 9px;
    color: var(--p-nav-ink); text-decoration: none; font-weight: 700; font-size: 15px; transition: background .15s, color .15s;
}
.p-nav-item .mud-icon-root { color: #AEBBD0; }
.p-nav-item:hover { background: rgba(255, 255, 255, .06); color: #FFFFFF; }
.p-nav-item.active { background: var(--p-accent); color: var(--p-accent-ink); box-shadow: 0 6px 16px -8px rgba(201, 162, 78, .9); }
.p-nav-item.active .mud-icon-root { color: #FFFFFF; }
.p-nav-item:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 1px; }
.p-sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.p-sidebar-foot .caption { font-size: 12.5px; color: #7F90A9; }

.p-main { background: var(--p-bg); min-height: 100vh; }
.p-content { max-width: 1360px; margin: 0 auto; padding: 24px 28px 48px; }
@media (max-width: 700px) { .p-content { padding: 18px 14px 40px; } }

/* ── search (CommandPalette) ── */
.p-palette-backdrop { position: fixed; inset: 0; z-index: 1400; background: rgba(10, 27, 54, .45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.p-palette { width: min(600px, 100%); background: var(--p-surface); border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(10, 27, 54, .6); overflow: hidden; }
.p-palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--p-line); color: var(--p-muted); }
.p-palette-input input { flex-grow: 1; height: 54px; border: none; outline: none; background: none; font: inherit; font-size: 17px; color: var(--p-ink); }
.p-palette-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.p-palette-group { padding: 10px 12px 4px; font-size: 12px; font-weight: 700; color: var(--p-muted); }
.p-palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: none; border-radius: 9px; background: none; font: inherit; color: var(--p-ink); text-align: start; cursor: pointer; }
.p-palette-item .mud-icon-root { color: var(--p-muted); }
.p-palette-item .hint { margin-inline-start: auto; font-size: 12.5px; color: var(--p-muted); }
.p-palette-item.sel, .p-palette-item:hover { background: var(--p-accent-soft); }
.p-palette-item.sel .mud-icon-root { color: var(--p-accent-dark); }
.p-palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--p-line); font-size: 12px; color: var(--p-muted); }
.p-palette-foot kbd { font-family: Consolas, monospace; border: 1px solid var(--p-line); border-radius: 4px; padding: 0 4px; direction: ltr; }

/* ── page header ── */
.p-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.p-header-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.p-kicker { font-size: 13px; font-weight: 700; color: var(--p-muted); }
.p-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--p-muted); text-decoration: none; }
.p-back:hover { color: var(--p-primary); }
.p-title { margin: 0; font-size: 27px; font-weight: 700; color: var(--p-ink); line-height: 1.3; }
.p-subtitle { margin: 0; color: var(--p-muted); font-size: 15px; }
.p-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── cards ── */
.p-card { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-radius); box-shadow: var(--p-shadow); padding: 20px 22px; overflow: hidden; }
.p-card.flush { padding: 0; overflow: hidden; }
.p-card h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--p-ink); }
.p-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 8px 18px; flex-wrap: wrap;
    background: var(--p-nav); color: #FFFFFF;
}
.p-card:not(.flush) > .p-card-head:first-child { margin: -20px -22px 18px; }
.p-card-head h2 { color: #FFFFFF; font-size: 16.5px; display: flex; align-items: center; gap: 8px; }
.p-card-head .p-muted { color: #A9B7CB; }
.p-card-head .p-link { color: var(--p-accent); }
.p-card-head .mud-button-outlined { color: #FFFFFF; border-color: rgba(255, 255, 255, .35); }
.p-card-head .mud-button-outlined:hover { background: rgba(255, 255, 255, .08); }
.p-card-head .mud-icon-button { color: #FFFFFF; }
.p-muted { color: var(--p-muted); font-size: 13px; }
.p-link { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 13.5px; color: var(--p-action); text-decoration: none; }
.p-link:hover { text-decoration: underline; }
.p-link-btn { border: none; background: none; font: inherit; font-weight: 700; color: var(--p-primary); cursor: pointer; }
.grow { flex-grow: 1; min-width: 0; }

.p-notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.p-notice.info { background: var(--t-review-bg); color: var(--t-review-fg); }
.p-notice.warn { background: var(--t-consultant-bg); color: var(--t-consultant-fg); }
.p-notice.error { background: var(--t-rejected-bg); color: var(--t-rejected-fg); }
.p-notice a { color: inherit; font-weight: 800; }

/* ── overview ── */
.p-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.p-module { display: flex; flex-direction: column; gap: 16px; }
.p-module-head { display: flex; align-items: center; gap: 12px; margin: -20px -22px 0; padding: 12px 18px; background: var(--p-nav); color: #FFFFFF; }
.p-module-head h2 { color: #FFFFFF; }
.p-module-head .p-muted { color: #A9B7CB; }
.p-module-head .p-link { color: var(--p-accent); }
.p-module-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(201, 162, 78, .16); color: var(--p-accent); flex-shrink: 0; }
.p-bar { display: flex; gap: 3px; height: 10px; border-radius: 6px; overflow: hidden; }
.p-bar .seg { min-width: 6px; flex-basis: 0; }
.p-bar .seg.empty { flex-grow: 1; background: var(--p-line-soft); }
.p-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; color: var(--p-text); }
.p-legend li { display: flex; align-items: center; gap: 8px; }
.p-legend b { margin-inline-start: auto; color: var(--p-ink); font-weight: 800; }
.p-legend .sw { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.p-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
@media (max-width: 500px) { .p-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.p-rows { list-style: none; margin: 0; padding: 0; }
.p-rows li + li { border-top: 1px solid var(--p-line-soft); }
.p-rows a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: inherit; text-decoration: none; }
.p-rows a:hover { background: #F9FAFB; }
.p-row-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--p-line-soft); color: var(--p-muted); flex-shrink: 0; }
.p-row-main { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.p-row-main .t { font-weight: 700; color: var(--p-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-row-main .d { font-size: 12.5px; color: var(--p-muted); }

/* ── tones: bar segments, legend swatches ── */
.seg.draft, .sw.draft { background: var(--t-draft); }
.seg.review, .sw.review { background: var(--t-review); }
.seg.consultant, .sw.consultant { background: var(--t-consultant); }
.seg.approved, .sw.approved { background: var(--t-approved); }
.seg.revise, .sw.revise { background: var(--t-revise); }
.seg.rejected, .sw.rejected { background: var(--t-rejected); }
.seg.neutral, .sw.neutral { background: var(--t-neutral); }

/* ── status chip ── */
.p-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px 2px 12px; border-radius: 999px; border: 1px solid var(--t-draft);
    font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--t-draft-bg); color: var(--t-draft-fg);
}
.p-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.p-chip.lg { font-size: 14px; padding: 6px 14px 6px 16px; }
.p-chip.review { background: var(--t-review-bg); color: var(--t-review-fg); border-color: var(--t-review); }
.p-chip.consultant { background: var(--t-consultant-bg); color: var(--t-consultant-fg); border-color: var(--t-consultant); }
.p-chip.approved { background: var(--t-approved-bg); color: var(--t-approved-fg); border-color: var(--t-approved); }
.p-chip.revise { background: var(--t-revise-bg); color: var(--t-revise-fg); border-color: var(--t-revise); }
.p-chip.rejected { background: var(--t-rejected-bg); color: var(--t-rejected-fg); border-color: var(--t-rejected); }
.p-chip.neutral { background: var(--t-neutral-bg); color: var(--t-neutral-fg); border-color: var(--t-neutral); }

/* ── stage track: compact (register rows) ── */
.p-track.compact { display: inline-flex; gap: 3px; vertical-align: middle; }
.p-track.compact .seg { width: 16px; height: 6px; border-radius: 3px; background: var(--p-line); }
.p-track.compact .seg.done { background: #9DB3CF; }
.p-track.compact.draft .seg.now { background: var(--t-draft); }
.p-track.compact.review .seg.now { background: var(--t-review); }
.p-track.compact.consultant .seg.now { background: var(--t-consultant); }
.p-track.compact.approved .seg.now, .p-track.compact.approved .seg.done { background: var(--t-approved); }
.p-track.compact.revise .seg.now { background: var(--t-revise); }
.p-track.compact.rejected .seg.now { background: var(--t-rejected); }
.p-track.compact.neutral .seg.now { background: var(--t-neutral); }

/* ── stage track: full (request page) ── */
.p-track.full { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.p-track.full li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.p-track.full li::before {
    content: ""; position: absolute; top: 15px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--p-line);
}
.p-track.full li:last-child::before { display: none; }
.p-track.full li.done::before { background: var(--p-primary); }
.p-track.full .node {
    position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: var(--p-surface); border: 2px solid var(--p-line); color: var(--p-muted); font-weight: 800; font-size: 13px;
}
.p-track.full li.done .node { background: var(--p-primary); border-color: var(--p-primary); color: #FFFFFF; }
.p-track.full .name { font-size: 12.5px; font-weight: 700; color: var(--p-muted); }
.p-track.full li.done .name { color: var(--p-text); }
.p-track.full li.now .name { color: var(--p-ink); }
.p-track.full.draft li.now .node { border-color: var(--t-draft); color: var(--t-draft-fg); background: var(--t-draft-bg); }
.p-track.full.review li.now .node { border-color: var(--t-review); color: var(--t-review-fg); background: var(--t-review-bg); }
.p-track.full.consultant li.now .node { border-color: var(--t-consultant); color: var(--t-consultant-fg); background: var(--t-consultant-bg); }
.p-track.full.approved li.now .node { border-color: var(--t-approved); background: var(--t-approved); color: #FFFFFF; }
.p-track.full.revise li.now .node { border-color: var(--t-revise); background: var(--t-revise); color: #FFFFFF; }
.p-track.full.rejected li.now .node { border-color: var(--t-rejected); background: var(--t-rejected); color: #FFFFFF; }
.p-track.full.neutral li.now .node { border-color: var(--t-neutral); background: var(--t-neutral-bg); }

/* ── decision badge A/B/C/D: lightness differs, not only hue ── */
.p-decision-wrap { display: inline-flex; align-items: center; gap: 8px; }
.p-decision {
    display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
    font-weight: 800; font-size: 13px; background: var(--p-line-soft); color: var(--p-muted);
}
.p-decision.none { background: transparent; color: #C0C6D0; }
.p-decision.cir-a { background: #067647; color: #FFFFFF; }
.p-decision.cir-b { background: #A6EFC9; color: #05603A; }
.p-decision.cir-c { background: #F79009; color: #2B1704; }
.p-decision.cir-d { background: #B42318; color: #FFFFFF; }
.p-decision-label { font-weight: 700; color: var(--p-ink); }

/* ── register ── */
.p-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.p-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.p-filter {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--p-line); background: var(--p-surface); color: var(--p-text); font: inherit; font-weight: 600; font-size: 13.5px;
}
.p-filter .n { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--p-line-soft); color: var(--p-muted); font-size: 12px; font-weight: 800; text-align: center; }
.p-filter:hover { border-color: #C3CAD5; }
.p-filter.on { background: var(--p-nav); border-color: var(--p-nav); color: #FFFFFF; }
.p-filter.on .n { background: rgba(255, 255, 255, .2); color: #FFFFFF; }
.p-filter:focus-visible, .p-select:focus-visible, .p-search:focus-within { outline: 2px solid var(--p-accent); outline-offset: 1px; }
.p-toolbar-end { display: flex; gap: 8px; flex-wrap: wrap; }
.p-select, .p-search {
    height: 38px; border: 1px solid var(--p-line); border-radius: 9px; background: var(--p-surface); color: var(--p-text); font: inherit; font-size: 13.5px;
}
.p-select { padding: 0 10px; }
.p-search { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--p-muted); min-width: 260px; }
.p-search input { border: none; outline: none; background: none; font: inherit; color: var(--p-ink); width: 100%; }
@media (max-width: 600px) { .p-search { min-width: 0; flex-grow: 1; } }

.p-table { width: 100%; border-collapse: collapse; }
.p-table th {
    text-align: start; font-size: 13px; font-weight: 700; color: var(--p-muted); background: #F6F8FB;
    padding: 11px 16px; border-bottom: 1px solid var(--p-line); white-space: nowrap;
}
.p-table td { padding: 13px 16px; border-bottom: 1px solid var(--p-line-soft); vertical-align: middle; }
.p-table tbody tr { cursor: pointer; transition: background .1s; }
.p-table tbody tr:hover { background: #FFFBE5; }
.p-table tbody tr:focus-visible { outline: 2px solid var(--p-accent); outline-offset: -2px; }
.p-table .num { font-weight: 700; color: var(--p-ink); white-space: nowrap; text-align: right; font-size: 13px; }
.p-table .title { min-width: 220px; }
.p-table .title .t { display: block; font-weight: 700; color: var(--p-ink); }
.p-table .title .d { display: block; font-size: 12.5px; color: var(--p-muted); margin-top: 2px; }
.p-table .muted { color: var(--p-muted); font-size: 13px; }
.p-table .nowrap { white-space: nowrap; }
.p-table .center { text-align: center; }
@media (max-width: 900px) { .p-table .hide-sm { display: none; } }
/* phones: each register row becomes a small card - number and decision, then the title, then status and stage. The
   item tables on a document's page keep their columns and scroll sideways in .p-grid-edit-wrap. */
@media (max-width: 700px) {
    .p-register thead { display: none; }
    .p-register, .p-register tbody { display: block; }
    .p-register tbody tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px;
        grid-template-areas: "num decision" "title title" "status stage"; border-bottom: 1px solid var(--p-line-soft);
    }
    .p-register td { padding: 0; border: none; }
    .p-register .num { grid-area: num; }
    .p-register .decision { grid-area: decision; }
    .p-register .title { grid-area: title; min-width: 0; }
    .p-register .status { grid-area: status; }
    .p-register .stage { grid-area: stage; align-self: center; }
}
.p-table-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: 13px; color: var(--p-muted); }
.p-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; color: var(--p-muted); text-align: center; }
.p-empty.small { flex-direction: row; justify-content: center; padding: 28px 16px; }
.p-empty.error { color: var(--t-rejected-fg); }

/* ── request page ── */
.p-summary { display: flex; flex-direction: column; gap: 20px; margin-bottom: 16px; }
.p-summary-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.p-summary-top .who { display: flex; flex-direction: column; gap: 2px; }
.p-pending { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--t-review-fg); font-weight: 600; }
.p-section-title { font-size: 13px; font-weight: 800; color: var(--p-muted); margin: 18px 0 8px; }

/* ── kept for the request/edit pages and the consultant's decision UI ── */
.portal-card { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-radius); box-shadow: var(--p-shadow); padding: 20px 22px; }
.portal-card.highlight { border-color: var(--t-consultant); box-shadow: 0 0 0 3px var(--t-consultant-bg); }
.portal-card h2 { margin: 0 0 14px; font-size: 17px; font-weight: 700; color: var(--p-ink); display: flex; align-items: center; gap: 8px; }
.portal-card h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--p-accent); flex-shrink: 0; }
.portal-notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--t-review-bg); color: var(--t-review-fg); font-size: 14px; font-weight: 600; }
.portal-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.portal-dl > div { display: flex; justify-content: flex-start; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--p-line-soft); }
.portal-dl dt { flex: 0 0 130px; color: var(--p-muted); font-size: 13.5px; }
.portal-dl dd { flex: 1; min-width: 0; margin: 0; font-weight: 700; color: var(--p-primary); text-align: right; }   /* the value right after its label, reading from the right, in navy */
@media (max-width: 700px) { .portal-dl { grid-template-columns: minmax(0, 1fr); } }
.portal-list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--p-line-soft); color: inherit; text-decoration: none; }
.portal-list-row:last-child { border-bottom: none; }
.portal-list-title { font-weight: 700; color: var(--p-ink); }
.portal-list-sub { font-size: 13px; color: var(--p-muted); }
.cir-code {
    display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px;
    font-weight: 800; font-size: 13px; background: var(--p-line-soft); color: var(--p-muted);
}
.cir-a { background: #067647; color: #FFFFFF; }
.cir-b { background: #A6EFC9; color: #05603A; }
.cir-c { background: #F79009; color: #2B1704; }
.cir-d { background: #B42318; color: #FFFFFF; }
.cir-decisions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .cir-decisions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cir-decision {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; cursor: pointer;
    border: 1px solid var(--p-line); border-radius: 10px; background: var(--p-surface); color: var(--p-ink); font: inherit;
}
.cir-decision:hover { border-color: #C3CAD5; }
.cir-decision .code { font-size: 20px; font-weight: 800; }
.cir-decision .text { font-size: 12.5px; font-weight: 600; }
.cir-decision.cir-a { background: #067647; color: #FFFFFF; border-color: transparent; }
.cir-decision.cir-b { background: #A6EFC9; color: #05603A; border-color: transparent; }
.cir-decision.cir-c { background: #F79009; color: #2B1704; border-color: transparent; }
.cir-decision.cir-d { background: #B42318; color: #FFFFFF; border-color: transparent; }

/* MudBlazor inputs inside the portal: white fields on the grey ground */
.p-shell .mud-input-outlined { background: var(--p-surface); }
.p-shell .mud-table { background: transparent; }

/* ── sign-in (Components/Pages/Login.razor, LoginLayout) ── */
.p-login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.p-login {
    width: 100%; max-width: 920px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
    background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 16px; box-shadow: 0 12px 32px rgba(16, 24, 40, .08);
}
.p-login-brand {
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 36px;
    background: radial-gradient(120% 90% at 100% 0%, #123A5C 0%, var(--p-nav) 60%); color: var(--p-nav-ink);
}
.p-login-pitch .kicker { display: inline-block; margin-bottom: 12px; font-size: 12.5px; font-weight: 700; color: var(--p-accent); letter-spacing: .2px; }
.p-login-pitch h2 { margin: 0 0 10px; color: #FFFFFF; font-size: 28px; font-weight: 800; line-height: 1.35; text-wrap: balance; }
.p-login-pitch p { margin: 0 0 22px; line-height: 1.7; color: #C9D3E0; }
.p-login-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.p-login-chips li {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
    color: #E4EAF1; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
}
.p-login-chips li .mud-icon-root { color: var(--p-accent); font-size: 16px; }
.p-login-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.p-login-form h1 { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: var(--p-ink); }
.p-login-form .p-muted { margin: 0 0 24px; }
@media (max-width: 760px) {
    .p-login { grid-template-columns: minmax(0, 1fr); }
    .p-login-brand { gap: 20px; padding: 24px; }
    .p-login-pitch h2 { font-size: 22px; }
    .p-login-form { padding: 28px 24px; }
}

/* ── files (SubmittalFiles, PendingFiles, FileRow) ── */
.p-files-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.p-files-head h2 { margin: 0; }
.p-label { font-weight: 800; color: var(--p-ink); }
.p-files { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.p-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--p-line); border-radius: 10px; background: #FCFCFD; }
.p-file-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--p-primary-soft); color: var(--p-primary); flex-shrink: 0; }
.p-file-main { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; color: inherit; text-decoration: none; }
a.p-file-main:hover .name { color: var(--p-primary); text-decoration: underline; }
.p-file-main .name { font-weight: 700; color: var(--p-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-file-main .meta { font-size: 12.5px; color: var(--p-muted); }
.p-files-empty { margin: 4px 0 8px; }
.p-pending-files { margin-top: 20px; }

/* ── request forms: desktop-like header grid (description spans the rows), checks, items editor ── */
.p-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; align-items: start; }
.p-form-grid .p-desc { grid-column: 3; grid-row: 1 / span 4; }
@media (max-width: 900px) {
    .p-form-grid { grid-template-columns: minmax(0, 1fr); }
    .p-form-grid .p-desc { grid-column: auto; grid-row: auto; }
}
.p-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 16px; }
@media (max-width: 700px) { .p-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.p-grid-edit-wrap { overflow-x: auto; max-width: 100%; min-width: 0; }
.p-grid-edit { width: 100%; min-width: 980px; border-collapse: collapse; }
.p-grid-edit th { text-align: start; font-size: 12px; font-weight: 700; color: var(--p-muted); background: #F9FAFB; padding: 10px 8px; border-bottom: 1px solid var(--p-line); white-space: nowrap; }
.p-grid-edit td { padding: 6px 6px; border-bottom: 1px solid var(--p-line-soft); vertical-align: top; }
.p-grid-edit .n { width: 40px; text-align: center; color: var(--p-muted); font-weight: 700; vertical-align: middle; }
.p-grid-edit .w-desc { width: 28%; }
.p-grid-edit .w-purpose { width: 18%; }
.p-grid-edit .req { color: var(--t-rejected); }
.p-grid-edit input, .p-grid-edit textarea {
    width: 100%; border: 1px solid var(--p-line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13.5px;
    color: var(--p-ink); background: var(--p-surface); resize: vertical;
}
.p-grid-edit input:focus, .p-grid-edit textarea:focus { outline: 2px solid var(--p-accent); outline-offset: 0; border-color: transparent; }
.p-grid-edit textarea.missing { border-color: #F5B5AE; background: #FFF8F7; }
/* a purchase request's toolbar and its inline forms (PrWorkflowPanel) */
.p-pr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 8px; }
.p-pr-action-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--p-line-soft); max-width: 640px; display: flex; flex-direction: column; gap: 6px; }
.p-pr-action-form .p-section-title { margin: 0 0 4px; }
/* a purchase order's form and page (phase 5.2) */
.p-po-lines { min-width: 2050px; }
.p-po-lines .w-num { width: 110px; }
.p-po-lines .w-pct { width: 82px; }
.p-po-lines td.num, .p-po-close td.num, .p-po-close th.num { text-align: center; vertical-align: middle; white-space: nowrap; }
.p-po-item { display: block; padding-top: 8px; font-weight: 700; color: var(--p-ink); }
.p-po-totals { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--p-line-soft); }
.p-po-apply { display: grid; grid-template-columns: 140px auto 140px auto; gap: 6px 8px; align-items: center; }
@media (max-width: 700px) { .p-po-apply { grid-template-columns: 1fr auto; } }
.p-po-sum { margin: 0; min-width: 280px; display: flex; flex-direction: column; gap: 4px; }
.p-po-sum > div { display: flex; justify-content: space-between; gap: 24px; font-size: 14px; }
.p-po-sum dt { color: var(--p-muted); }
.p-po-sum dd { margin: 0; font-weight: 700; direction: ltr; unicode-bidi: isolate; text-align: right; color: var(--p-ink); }
.p-po-sum .grand { border-top: 1px solid var(--p-line); padding-top: 6px; font-size: 16px; }
.p-po-sum .grand dd { font-weight: 900; }
.p-po-terms-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-top: 18px; }
.p-po-terms { min-width: 760px; }
.p-po-terms .w-title { width: 30%; }
.p-po-terms td.w-move, .p-po-terms th.w-move { width: 120px; white-space: nowrap; vertical-align: middle; }
.p-po-terms tr.heading textarea { font-weight: 800; background: #F3F4F6; }
.p-po-clauses { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.p-po-clauses td { border: 1px solid var(--p-line-soft); padding: 8px 10px; vertical-align: top; white-space: pre-line; }
.p-po-clauses .n { width: 40px; text-align: center; color: var(--p-muted); font-weight: 700; }
.p-po-clauses .t { width: 28%; font-weight: 700; }
.p-po-clauses tr.heading td { background: #F3F4F6; font-weight: 800; }
.p-pr-action-form.wide { max-width: none; }
.p-po-close { min-width: 820px; }
/* store vouchers (phase 5.3) */
.p-stock-lines { min-width: 1250px; }
.p-stock-lines .w-num { width: 110px; }
.p-stock-lines td.num { text-align: center; vertical-align: middle; white-space: nowrap; }
.p-register-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.p-register-tools .grow { flex: 1 1 260px; }
.p-more { display: flex; justify-content: center; padding: 10px; border-top: 1px solid var(--p-line-soft); }
/* stock reports and master lists (phase 5.4) */
.p-register-tools .p-tool-pick { flex: 0 1 240px; min-width: 190px; }
.p-sums { display: flex; flex-wrap: wrap; gap: 10px; }
.p-sum { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-radius: 10px; background: #F9FAFB; border: 1px solid var(--p-line-soft); min-width: 150px; }
.p-sum .l { font-size: 12.5px; color: var(--p-muted); font-weight: 600; }
.p-sum .v { font-size: 19px; font-weight: 800; color: var(--p-ink); direction: ltr; text-align: end; font-variant-numeric: tabular-nums; }
.p-sum .v small { font-size: 12px; color: var(--p-muted); font-weight: 600; }
.p-neg { color: var(--t-rejected-fg); }
.p-master .mud-table { box-shadow: none; border-radius: 0; }
.p-master .mud-table-head .mud-table-cell { font-weight: 700; color: var(--p-muted); background: #F9FAFB; }
/* purchase task distribution (PurchaseAssignmentsView) */
.p-assign-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.p-assign-bar > .p-muted { flex: 1 1 260px; }
.p-assign-bar .p-assign-buyer { flex: 0 1 260px; min-width: 200px; }
.p-table tr.p-row-new td { font-weight: 800; background: #FFFBE5; }
/* a purchase request's lines (phase 5.1): Mud pickers inside the cells */
.p-pr-lines { min-width: 1500px; }
.p-pr-lines .w-item { width: 260px; }
.p-pr-lines .w-desc { width: 220px; }
.p-pr-lines .w-qty { width: 110px; }
.p-pr-lines .w-pick { width: 210px; }
.p-pr-lines td.muted { vertical-align: middle; color: var(--p-muted); white-space: nowrap; }
.p-pr-lines .mud-input-control { margin: 0; }
.p-pr-lines .mud-input-control .mud-input input { border: 0; padding: 7px 9px; background: transparent; outline: none; }
.p-items-view .decision-cell { display: flex; flex-direction: column; gap: 4px; }

/* ── request forms: the desktop's two columns (CIR) ── */
.p-form-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.p-form-col { display: flex; flex-direction: column; gap: 16px; }
.p-form-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .p-form-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* ── etmam ARABIA brand: login mark, logo, remember, first-login card ── */
.p-login-mark { display: flex; align-items: center; gap: 12px; }
.p-login-mark .bar { width: 6px; height: 44px; border-radius: 3px; background: var(--p-accent); }
.p-login-mark .text { display: flex; flex-direction: column; line-height: 1.3; }
.p-login-mark .name { color: #FFFFFF; font-weight: 900; font-size: 22px; }
.p-login-mark .sub { color: #C9D3E0; font-size: 14px; font-weight: 600; }
.p-login-foot { font-size: 12px; color: #6B7C92; }
.p-login-logo { display: block; width: 150px; height: auto; margin: 0 auto 18px; }
.p-login-form h1 { text-align: center; }
.p-login-form > .p-muted { text-align: center; }
.p-remember { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--p-text); cursor: pointer; user-select: none; }
.p-remember input { width: 16px; height: 16px; accent-color: var(--p-primary); }
.p-login.single { max-width: 460px; grid-template-columns: minmax(0, 1fr); }

.p-nav-count {
    margin-inline-start: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center;
    background: #E04848; color: #FFFFFF; font-size: 12px; font-weight: 700;
}

/* ── approvals (ApprovalActions) and My Tasks ── */
.p-approve { border-color: #EFD970; box-shadow: 0 0 0 3px var(--p-accent-soft); }
.p-approve-head { display: flex; align-items: center; gap: 12px; }
.p-approve-head > .mud-icon-root { color: var(--p-accent-dark); }
.p-approve-buttons { display: flex; flex-wrap: wrap; gap: 12px 8px; margin-top: 12px; }
.p-task-group + .p-task-group { margin-top: 16px; }
.p-task { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.p-task + .p-task { border-top: 1px solid var(--p-line-soft); }
.p-task .p-row-main a { color: inherit; text-decoration: none; }
.p-task .p-row-main a:hover .t { color: var(--p-primary); text-decoration: underline; }
.p-task-meta { font-size: 12.5px; color: var(--p-muted); }
.p-task-actions { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 700px) { .p-task { flex-wrap: wrap; } .p-task-actions { width: 100%; } }
.p-po-amount { font-size: 22px; font-weight: 800; color: var(--p-ink); direction: ltr; text-align: right; }
.p-po-amount small { font-size: 13px; color: var(--p-muted); font-weight: 600; }

/* ── dashboard pieces: welcome banner (PortalHero), KPI cards (KpiCard) ── */
.p-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    min-height: 170px; padding: 24px 32px; margin-bottom: 18px; border-radius: 12px; color: #FFFFFF;
    background: #0A1B36 url('img/hero-tower.jpg') 30% 22% / cover no-repeat;
}
/* navy wash: deepest behind the title (start = right), the tower and sky showing through toward the other end */
.p-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(270deg, rgba(10, 27, 54, .92) 0%, rgba(10, 27, 54, .7) 38%, rgba(10, 27, 54, .2) 68%, rgba(10, 27, 54, .45) 100%); }
.p-hero > div { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.p-hero h1 { margin: 0; font-size: 28px; font-weight: 700; color: #FFFFFF; text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.p-hero .date { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #E7ECF3; }
.p-hero .sub { font-size: 14.5px; color: #DCE4EE; max-width: 60ch; }
.p-hero .slogan { font-size: 25px; font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.p-hero .slogan::after { content: ""; display: block; width: 80px; height: 3px; margin-top: 8px; border-radius: 2px; background: var(--p-accent); }
@media (max-width: 800px) { .p-hero .slogan { display: none; } .p-hero { padding: 20px; } .p-hero h1 { font-size: 23px; } }

.p-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.p-kpi {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; color: inherit; text-decoration: none;
    background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; box-shadow: var(--p-shadow); transition: border-color .15s, box-shadow .15s;
}
a.p-kpi:hover { border-color: var(--kpi); box-shadow: 0 6px 18px -10px rgba(10, 27, 54, .35); }
a.p-kpi:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }
.p-kpi .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p-kpi .value { font-size: clamp(24px, 2.3vw, 32px); font-weight: 700; line-height: 1.1; color: var(--p-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.p-kpi .label { font-size: 15px; font-weight: 700; color: var(--p-text); }
.p-kpi .hint { font-size: 12.5px; color: var(--p-muted); }
.p-kpi .ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--kpi) 14%, #FFFFFF); color: var(--kpi); }
.p-kpi .ico .mud-icon-root { font-size: 30px; }

/* ── user menu (PortalLayout) ── */
.p-menu-head { display: flex; flex-direction: column; padding: 10px 16px 8px; min-width: 220px; border-bottom: 1px solid var(--p-line); }
.p-menu-head .name { font-weight: 700; color: var(--p-ink); }
.p-menu-head .role { font-size: 12.5px; color: var(--p-muted); }
.p-menu-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; border: none; background: none; cursor: pointer;
    font: inherit; color: var(--p-ink); text-align: start;
}
.p-menu-btn:hover { background: var(--p-line-soft); }
.p-menu-btn:focus-visible { outline: 2px solid var(--p-accent); outline-offset: -2px; }

/* ── executive overview (ExecutiveOverview, phase 2.1) ── */
.p-dash-row { display: grid; gap: 16px; margin-bottom: 16px; }
.p-dash-row.three { grid-template-columns: 1.15fr 1.1fr .9fr; }
.p-dash-row.wide { grid-template-columns: minmax(280px, .8fr) 2fr; }
@media (max-width: 1200px) { .p-dash-row.three { grid-template-columns: 1fr 1fr; } .p-dash-row.three > :first-child { grid-column: 1 / -1; } }
@media (max-width: 900px) { .p-dash-row.three, .p-dash-row.wide { grid-template-columns: minmax(0, 1fr); } }
.p-dash-row > .p-card { min-width: 0; display: flex; flex-direction: column; }
.p-card-body { padding: 16px 18px; flex-grow: 1; }
.p-section-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; font-size: 19px; font-weight: 700; color: var(--p-ink); }
.p-section-head::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--p-accent); }

.p-feat { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px 18px; flex-grow: 1; }
.p-feat .info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.p-feat h3 { margin: 0; font-size: 19px; color: var(--p-ink); line-height: 1.3; }
.p-feat .code { color: var(--p-accent-dark); font-weight: 700; font-size: 13.5px; direction: ltr; text-align: right; }
.p-feat dl { margin: 0; display: grid; gap: 6px; width: 100%; }
.p-feat dl div { display: flex; flex-direction: column; }
.p-feat dt { font-size: 12.5px; color: var(--p-muted); }
.p-feat dd { margin: 0; font-weight: 700; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.p-feat .photo { border-radius: 10px; min-height: 230px; background-color: var(--p-primary-soft); background-size: cover, cover; background-position: center 25%, center; }
@media (max-width: 500px) { .p-feat { grid-template-columns: minmax(0, 1fr); } .p-feat .photo { min-height: 180px; order: -1; } }
.p-feat-nav { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #A9B7CB; }
.p-feat-nav button { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .2); background: none; color: #FFFFFF; cursor: pointer; }
.p-feat-nav button:hover { background: rgba(255, 255, 255, .1); }
.p-ring {
    --v: 0; align-self: center; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%;
    background: conic-gradient(#1F6FD1 calc(var(--v) * 1%), #E4EAF2 0);
}
.p-ring b { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--p-surface); font-size: 19px; color: var(--p-ink); }

.p-chart { width: 100%; height: auto; display: block; }
.p-chart .grid { stroke: #EDF1F5; }
.p-chart .axis { fill: var(--p-muted); font-size: 11px; }
.p-chart polyline { fill: none; stroke-width: 2.5; }
.p-chart polyline.actual { stroke: var(--p-primary); }
.p-chart polyline.planned { stroke: #E8A93A; stroke-dasharray: 5 4; }
.p-chart .actual-dot { fill: var(--p-primary); }
.p-chart .planned-dot { fill: #E8A93A; }
.p-chart .tag { fill: var(--p-primary); }
.p-chart .tag-text { fill: #FFFFFF; font-size: 12px; font-weight: 700; }
.p-chart .tag-planned { fill: #E8A93A; }
.p-chart .tag-text-planned { fill: #3A2A05; font-size: 12px; font-weight: 700; }
.p-chart-legend { display: flex; gap: 16px; font-size: 13px; color: var(--p-muted); margin-bottom: 4px; }
.p-chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.p-chart-legend i.actual { background: var(--p-primary); }
.p-chart-legend i.planned { background: #E8A93A; }

.p-donut { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: 14px; align-items: center; }
.p-donut svg { width: 100%; height: auto; }
.p-donut .total { font-size: 28px; font-weight: 700; fill: var(--p-ink); }
.p-donut .unit { font-size: 13px; fill: var(--p-muted); }
.p-legend.single { grid-template-columns: minmax(0, 1fr); }

.p-alerts { list-style: none; margin: 0; padding: 4px 18px 10px; }
.p-alerts li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--p-line-soft); }
.p-alerts li:last-child { border-bottom: none; }
.p-alerts .mark { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #FFFFFF; font-weight: 700; font-size: 13px; background: #E8962E; }
.p-alerts li.bad .mark { background: #E04848; }
.p-alerts li.info .mark { background: #1F6FD1; }
.p-alerts .txt { display: flex; flex-direction: column; min-width: 0; }
.p-alerts .txt b { color: var(--p-ink); font-size: 14.5px; }
.p-alerts .txt small { color: var(--p-muted); font-size: 12.5px; }

.p-proj-table { min-width: 640px; }
/* EXECTBL: the overview's alerts in columns across the page, and the full-width projects register a little tighter */
.p-alerts.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 28px; }
.p-proj-compact th, .p-proj-compact td { padding: 10px 10px; }
.p-proj-compact td.title { min-width: 180px; }
.p-proj-compact .p-progress .track { width: 80px; }
.p-proj-compact th { font-size: 12px; }
/* EXECTBL: cost control - the seven figures in one row on a wide screen, the summary read as a statement */
.p-kpis.p-kpis-cc { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1500px) { .p-kpis.p-kpis-cc { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .p-kpis.p-kpis-cc { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.p-kpis.p-kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1300px) { .p-kpis.p-kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .p-kpis.p-kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* BOQLINK-WEB: linking BOQ items to schedule activities on the pricing page's coverage tab */
.p-pick-col { width: 36px; text-align: center; }
.p-bulk-link { margin: 0 18px 12px; padding: 12px 14px; border: 1px solid #F0DDA8; background: #FFF8E6; border-radius: 10px; display: flex; flex-direction: column; gap: 10px; }
.p-bulk-link-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.p-bulk-link-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.p-node-pick { border: 1px solid var(--p-line); border-radius: 10px; background: var(--p-surface); }
.p-node-pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 10px; border-bottom: 1px solid var(--p-line-soft); }
.p-node-pick-bar input[type=search] { flex: 1; min-width: 200px; border: 1px solid var(--p-line); border-radius: 8px; padding: 7px 10px; font: inherit; }
.p-node-pick ul { list-style: none; margin: 0; padding: 4px; max-height: 280px; overflow-y: auto; }
.p-node-pick li button { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; width: 100%; text-align: start; padding: 7px 8px; border: none; border-radius: 6px; background: none; font: inherit; cursor: pointer; }
.p-node-pick li button:hover, .p-node-pick li button:focus-visible { background: #EEF4FF; }
.p-node-pick .code { font-weight: 700; color: var(--p-ink); min-width: 80px; }
.p-node-pick .name { flex: 1; min-width: 160px; }
.p-node-pick-foot { padding: 6px 12px; font-size: 12px; }
.p-link-edit { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.p-link-edit-h { font-size: 14px; margin: 6px 0 0; }
.p-link-edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.p-pct { width: 90px; border: 1px solid var(--p-line); border-radius: 6px; padding: 5px 8px; font: inherit; text-align: right; direction: ltr; }
.p-cf-story { margin-bottom: 12px; align-items: flex-start; line-height: 1.7; }
.p-cf-story a { margin-inline-start: 6px; font-weight: 700; }
.p-cf th.now { background: #FFF3D6; color: var(--p-ink); }
.p-summary-table { table-layout: fixed; }
.p-summary-table th, .p-summary-table td { padding: 9px 14px; }
.p-summary-table th.num { text-align: right; }
/* section titles navy with white text; the totals (key rows) light gold with a gold bar - the two never look alike */
.p-summary-table tr.sec td, .p-summary-table tr.sec:hover td { background: #16325C; color: #FFFFFF; font-weight: 800; font-size: 13.5px; padding-block: 8px; letter-spacing: .2px; }
.p-summary-table td.name { color: var(--p-ink); font-size: 14px; }
.p-summary-table td.num { font-size: 14px; }
.p-summary-table td.basis { color: var(--p-muted); font-size: 12.5px; line-height: 1.5; }
.p-summary-table tr.key td { background: #FBF3DF; color: var(--p-ink); font-weight: 800; }
.p-summary-table tr.key:hover td { background: #F8ECCB; }
.p-summary-table tr.key td:first-child { box-shadow: inset -4px 0 0 var(--p-accent); }
.p-summary-table tr.key td.basis { font-weight: 400; color: #6B5A2E; }
.p-summary-table a.trace { font-size: 12.5px; }
@media (max-width: 700px) { .p-summary-table { table-layout: auto; } .p-summary-table th, .p-summary-table td { padding: 8px 8px; } }
.p-proj-compact td { font-size: 13.5px; }
.p-proj-compact .title .t { font-size: 14px; }
.p-proj-compact .title .d { font-size: 11.5px; }
.p-proj-compact .p-chip { font-size: 12px; }
.p-proj-compact .p-progress b { font-size: 12px; }
.p-table tbody tr.static { cursor: default; }
.p-progress { display: inline-flex; align-items: center; gap: 8px; }
.p-progress .track { position: relative; display: block; width: 110px; height: 8px; border-radius: 4px; background: #E8EEF5; }
.p-progress .track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 4px; }
.p-progress .track u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--p-ink); }
.p-progress b { font-size: 13px; color: var(--p-ink); font-variant-numeric: tabular-nums; min-width: 42px; }

/* ── projects dashboard and command center (phase 2.4) ── */
.p-kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .p-kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .p-kpis.six { grid-template-columns: minmax(0, 1fr); } }
.p-hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.p-hbars li { display: grid; grid-template-columns: minmax(70px, 120px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.p-hbars .name { color: var(--p-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-hbars .bars { display: flex; flex-direction: column; gap: 3px; }
.p-hbars .bars i { display: block; height: 12px; border-radius: 0 3px 3px 0; min-width: 2px; }
.p-hbars .bars i.second { height: 6px; }
.p-hbars b { font-size: 12.5px; color: var(--p-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.p-project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.p-project-card {
    display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none;
    background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; box-shadow: var(--p-shadow); transition: border-color .15s, box-shadow .15s;
}
.p-project-card:hover { border-color: var(--p-accent); box-shadow: 0 8px 22px -12px rgba(10, 27, 54, .4); }
.p-project-card:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }
.p-project-card .photo { height: 150px; background-color: var(--p-primary-soft); background-size: cover, cover; background-position: center 25%, center; }
.p-project-card .body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.p-project-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.p-project-card .code { color: var(--p-accent-dark); font-weight: 700; font-size: 13.5px; direction: ltr; text-align: right; }
.p-project-card .name { font-size: 17px; font-weight: 700; color: var(--p-ink); line-height: 1.35; }
.p-project-card .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--p-muted); }
.p-project-card .flags { display: flex; flex-wrap: wrap; gap: 6px; }
.p-project-card .p-progress .track { width: 100%; }
.p-project-card .p-progress { display: flex; }

.p-project-head { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(220px, 300px); gap: 20px; align-items: stretch; margin-bottom: 16px; }
.p-project-head .photo { border-radius: 10px; min-height: 150px; background-color: var(--p-primary-soft); background-size: cover, cover; background-position: center 25%, center; }
.p-project-head .who { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.p-project-head .code { color: var(--p-accent-dark); font-weight: 700; direction: ltr; text-align: right; }
.p-project-head .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.p-project-head dl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; }
.p-project-head dl div { display: flex; flex-direction: column; min-width: 0; }
.p-project-head dt { font-size: 12.5px; color: var(--p-muted); }
.p-project-head dd { margin: 0; font-weight: 700; color: var(--p-ink); overflow-wrap: anywhere; }
.p-project-head .value { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.p-project-head .value b { font-size: 22px; color: var(--p-accent-dark); font-variant-numeric: tabular-nums; }
.p-progress.wide, .p-progress.wide .track { width: 100%; }
@media (max-width: 1000px) { .p-project-head { grid-template-columns: 160px minmax(0, 1fr); } .p-project-head .value { grid-column: 1 / -1; } }
@media (max-width: 600px) { .p-project-head { grid-template-columns: minmax(0, 1fr); } .p-project-head dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.p-row-plain { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
.p-row-link { color: var(--p-ink); text-decoration: none; }
.p-row-link:hover { color: var(--p-accent-dark); text-decoration: underline; }

/* ── executive platform tabs (ExecutivePlatform, phase 2.2) ── */
.p-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 18px; padding: 4px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; }
.p-tabs a { flex-shrink: 0; padding: 9px 18px; border-radius: 9px; color: var(--p-muted); font-weight: 700; text-decoration: none; white-space: nowrap; }
.p-tabs a:hover { background: var(--p-line-soft); color: var(--p-ink); }
.p-tabs a.on { background: var(--p-nav); color: #FFFFFF; box-shadow: inset 0 -3px 0 var(--p-accent); }
.p-tabs a:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 1px; }
/* NAVORG: the strip above a page that the menu merged under one entry (SectionTabs) - lighter than a page's own tabs */
.p-section-tabs { margin: -8px 0 14px; padding: 3px; background: transparent; border: none; border-bottom: 1px solid var(--p-line); border-radius: 0; gap: 2px; }
.p-section-tabs a { padding: 7px 14px; border-radius: 8px 8px 0 0; font-size: 13.5px; }
.p-section-tabs a.on { background: transparent; color: var(--p-primary); box-shadow: inset 0 -3px 0 var(--p-accent); }
.p-dash-row.wide.reverse { grid-template-columns: 2fr minmax(280px, .8fr); }
@media (max-width: 900px) { .p-dash-row.wide.reverse { grid-template-columns: minmax(0, 1fr); } }
.p-kpi-button { display: block; padding: 0; border: none; background: none; font: inherit; text-align: inherit; cursor: pointer; border-radius: 12px; }
.p-kpi-button .p-kpi { height: 100%; }
.p-kpi-button:hover .p-kpi { border-color: var(--kpi); }
.p-kpi-button.on .p-kpi { border-color: var(--kpi); background: color-mix(in srgb, var(--kpi) 8%, #FFFFFF); box-shadow: 0 0 0 2px color-mix(in srgb, var(--kpi) 25%, transparent); }
.p-kpi-button:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }
.p-stacks { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 14px; }
.p-stacks li { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; }
.p-stacks .stack { display: flex; height: 16px; border-radius: 4px; overflow: hidden; background: var(--p-line-soft); gap: 2px; }
.p-stacks .stack i { display: block; min-width: 3px; }
.p-stacks b { text-align: right; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.p-late { color: #C23434; font-weight: 700; }

/* ── executive finance tabs (phase 2.3) ── */
.p-dash-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .p-dash-row.two { grid-template-columns: minmax(0, 1fr); } }
.p-money td, .p-money th { white-space: nowrap; }
.p-money td { font-variant-numeric: tabular-nums; }
.p-money td.title { white-space: normal; min-width: 180px; }
/* numbers read left-to-right inside the RTL page, so a negative shows as -27.5M, not 27.5M- */
.p-money td:not(.title):not(.txt), .p-hbars b { direction: ltr; unicode-bidi: isolate; text-align: right; }
/* EXECTBL: Arabic text inside a money table stays right-to-left and may wrap; amounts in other tables read as in a money table */
.p-money td.txt { white-space: normal; min-width: 130px; }
.p-table td.amt { direction: ltr; unicode-bidi: isolate; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-table th.wrap { white-space: normal; min-width: 92px; line-height: 1.35; vertical-align: bottom; }
.p-table th.wrap.narrow { min-width: 66px; }
.p-table thead tr.groups th { text-align: center; color: var(--p-ink); padding-block: 8px; }
.p-table th.g-start, .p-table td.g-start { border-inline-start: 1px solid var(--p-line); }
.p-table tfoot td.title { white-space: nowrap; }
/* EXECTBL: a wide report table - tighter cells, the project column stays in view while the figures scroll */
.p-money.p-compact th, .p-money.p-compact td { padding: 9px 10px; font-size: 13px; }
.p-money.p-compact th.wrap { min-width: 78px; }
.p-money.p-compact td.title { min-width: 165px; }
@media (min-width: 701px) {
    .p-sticky-first thead tr:first-child th:first-child, .p-sticky-first tbody td:first-child, .p-sticky-first tfoot td:first-child { position: sticky; inset-inline-start: 0; z-index: 2; box-shadow: inset 1px 0 0 var(--p-line); }
    .p-sticky-first tbody td:first-child { background: var(--p-surface); }
    .p-sticky-first tbody tr:hover td:first-child { background: #FFFBE5; }
}
/* a table sharing the row with another one: every column fits without scrolling on a desktop */
.p-table.p-narrow th, .p-table.p-narrow td { padding-inline: 10px; }
.p-table.p-narrow td.title { min-width: 150px; }
.p-table.p-narrow th.wrap.narrow { min-width: 56px; }
/* BACKNAV: the trail of the pages above this one, over the title (Breadcrumbs.razor) */
.p-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; color: var(--p-muted); line-height: 1.6; }
.p-crumbs a { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 6px; color: var(--p-primary); text-decoration: none; }
.p-crumbs a:hover { background: rgba(127, 140, 160, .14); text-decoration: underline; text-underline-offset: 3px; }
.p-crumbs a:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 1px; }
.p-crumbs a .mud-icon-root { font-size: 16px; }
.p-crumbs .sec { padding: 1px 2px; color: var(--p-muted); }
.p-crumbs .sep { font-size: 16px; color: var(--p-muted); opacity: .7; }
.p-crumbs.dark, .p-crumbs.dark .sec, .p-crumbs.dark .sep { color: #C9D3E0; }
.p-crumbs.dark a { color: var(--p-accent); }
.p-crumbs.dark a:hover { background: rgba(255, 255, 255, .1); }
@media print { .p-crumbs { display: none; } }
/* a figure that opens the record behind it */
a.p-drill { color: inherit; text-decoration: none; border-bottom: 1px dotted #9AA8BA; }
a.p-drill:hover, a.p-drill:focus-visible { color: var(--p-accent-dark); border-bottom: 1px solid currentColor; }
.p-fin-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.p-fin-flag { font-size: 11px; line-height: 1.5; padding: 0 7px; border-radius: 999px; background: #FFF3DC; color: #8A5209; white-space: nowrap; }
.p-fin-flag.alert { background: #FDE7E7; color: #A12828; }
.p-fin-mark { color: #8A5209; font-weight: 700; margin-inline-start: 2px; }
.p-table td.p-warn-num, .p-table td.p-warn-num a { color: #B5650B; }
.p-kpi .value { unicode-bidi: plaintext; text-align: right; }

/* ── projects list (ProjectsRegister, phase 3.1): the list and the selected project's details side by side ── */
.p-list-detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .p-list-detail { grid-template-columns: minmax(0, 1fr); } }
.p-table tbody tr.sel td { background: #FFFBE5; }
.p-table tbody tr.sel td:first-child { box-shadow: inset -3px 0 0 var(--p-accent); }
.p-detail { position: sticky; top: 80px; }
.p-detail .photo { display: block; height: 170px; background-color: var(--p-primary-soft); background-size: cover, cover; background-position: center 25%, center; }
.p-detail h3 { margin: 0 0 4px; font-size: 19px; color: var(--p-ink); }
.p-detail .code-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.p-detail .code { color: var(--p-accent-dark); font-weight: 700; direction: ltr; text-align: right; }
.portal-dl.single { grid-template-columns: minmax(0, 1fr); }
.p-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.p-detail-actions > :first-child { grid-column: 1 / -1; }

/* ── project form (ProjectEditor, phase 3.2): the desktop's tab strip, two field columns, inline record editors ── */
.p-form-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 10px; background: var(--p-nav); }
.p-form-tabs button {
    flex-shrink: 0; padding: 12px 16px; border: none; background: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px;
    color: #A9B7CB; border-bottom: 3px solid transparent; white-space: nowrap;
}
.p-form-tabs button:hover { color: #FFFFFF; }
.p-form-tabs button.on { color: #FFFFFF; border-bottom-color: var(--p-accent); }
.p-form-tabs button.bad { color: #F4A3A3; }
.p-form-tabs button:focus-visible { outline: 2px solid var(--p-accent); outline-offset: -2px; }
.p-form-tabs em { font-style: normal; font-size: 11.5px; margin-inline-start: 6px; padding: 0 7px; border-radius: 9px; background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.p-form-page { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 4px; }
.p-readonly { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px dashed var(--p-line); border-radius: 8px; background: #F8FAFC; }
.p-readonly span { font-size: 12.5px; color: var(--p-muted); }
.p-readonly b { color: var(--p-ink); font-variant-numeric: tabular-nums; }
.p-readonly.late b { color: #C23434; }
.p-problems { margin: 0; padding-inline-start: 18px; }
.p-project-head .photo.clickable { position: relative; cursor: pointer; overflow: hidden; }
.p-project-head .photo .hint {
    position: absolute; inset: auto 0 0 0; padding: 6px; text-align: center; font-size: 12.5px; font-weight: 700; color: #FFFFFF;
    background: rgba(10, 27, 54, .6); opacity: 0; transition: opacity .15s;
}
.p-project-head .photo:not(.clickable) { position: relative; overflow: hidden; }
.p-project-head .photo:not(.clickable) .hint { opacity: 1; background: rgba(10, 27, 54, .45); }
.p-project-head .photo.clickable:hover .hint, .p-project-head .photo.clickable:focus-within .hint { opacity: 1; }
.p-hidden-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.p-head-name { margin: 0; font-size: 21px; color: var(--p-ink); }
.p-sub-list { margin-top: 18px; box-shadow: none; }
.p-sub-list .p-card-head .mud-button-root { margin-inline-start: auto; }
.p-sub-note { display: flex; gap: 8px; align-items: center; padding: 10px 18px; font-size: 13.5px; color: var(--p-muted); background: #F8FAFC; border-bottom: 1px solid var(--p-line-soft); }
.p-sub-editor { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; background: var(--p-accent-soft); border-bottom: 1px solid #EFD970; }
.p-sub-actions { display: flex; gap: 8px; }
.p-row-tools { white-space: nowrap; text-align: end; }
.p-icon-btn.small { width: 32px; height: 32px; border: none; background: none; cursor: pointer; display: inline-grid; }
.p-icon-btn.danger { color: #C23434; }
.p-wrap { white-space: normal; max-width: 320px; }

/* ── change orders (ProjectChangeOrders, phase 3.4): seven KPIs, a wider detail panel with the workflow stepper and history ── */
.p-kpis.seven { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1300px) { .p-kpis.seven { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .p-kpis.seven { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .p-kpis.seven { grid-template-columns: minmax(0, 1fr); } }
.p-list-detail.wide { grid-template-columns: minmax(0, 1fr) 420px; }
@media (max-width: 1100px) { .p-list-detail.wide { grid-template-columns: minmax(0, 1fr); } }
.p-table td.num, .portal-dl dd.num { direction: ltr; unicode-bidi: isolate; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-table td.nowrap { white-space: nowrap; }
.p-table td.neg, .portal-dl dd.neg { color: #C23434; }
.portal-dl dd.warn { color: #B54708; }
.p-table tfoot td { padding: 10px 12px; font-weight: 800; color: var(--p-ink); background: #F8FAFC; border-top: 2px solid var(--p-line); }
.p-card-head .p-chip { margin-inline-start: auto; }
.p-steps { list-style: none; display: flex; margin: 0; padding: 16px 12px 4px; }
.p-steps li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--p-muted); text-align: center; }
.p-steps li + li::before { content: ""; position: absolute; top: 11px; inset-inline-start: -50%; width: 100%; height: 2px; background: var(--p-line); }
.p-steps li.done + li::before, .p-steps li.done + li.current::before { background: #1F9D55; }
.p-steps .dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: #FFFFFF; border: 2px solid var(--p-line); color: #FFFFFF; }
.p-steps li.done .dot { background: #1F9D55; border-color: #1F9D55; }
.p-steps li.current { color: var(--p-ink); }
.p-steps li.current .dot { background: var(--p-nav); border-color: var(--p-nav); box-shadow: 0 0 0 3px var(--p-accent-soft), 0 0 0 5px var(--p-accent); }
.p-steps li.failed { color: #C23434; }
.p-steps li.failed .dot { background: #E04848; border-color: #E04848; }
.p-steps li.skipped .dot { border-style: dashed; color: var(--p-muted); }
.p-co-desc { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: #F8FAFC; color: var(--p-ink); white-space: pre-wrap; }
.p-co-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.p-co-step { margin: 14px -18px 0; border-top: 1px solid #EFD970; }
.p-co-history-title { margin: 18px 0 8px; font-size: 15px; color: var(--p-nav); }
.p-co-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.p-co-history li { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-inline-start: 3px solid var(--p-accent); background: #FBFCFE; margin-bottom: 6px; border-start-end-radius: 6px; border-end-end-radius: 6px; }
.p-co-history .when { font-size: 12px; color: var(--p-muted); direction: ltr; text-align: right; }
.p-co-history .note { font-size: 13px; color: var(--p-text); white-space: pre-wrap; }

/* ── schedule (ProjectSchedule, phase 3.4): WBS tree rows, a timeline bar per row and today's line ── */
.p-sched td { vertical-align: middle; }
.p-sched th.name, .p-sched td.name { min-width: 230px; }
.p-sched .p-progress .track { width: 70px; }
.p-sched td.name .cell { display: flex; align-items: center; gap: 4px; }
.p-sched td.name .txt { display: flex; flex-direction: column; min-width: 0; }
.p-sched td.name .t { white-space: normal; }
.p-sched td.name .d { font-size: 12px; color: var(--p-muted); white-space: normal; }
.p-sched tr.wbs td { background: #F6F8FB; }
.p-sched tr.wbs td.name .t { font-weight: 800; color: var(--p-nav); }
.p-sched tr.top td { background: #EEF2F8; }
.p-sched .p-muted.small { display: block; font-size: 11.5px; }
.p-tree-toggle { width: 26px; height: 26px; flex-shrink: 0; display: inline-grid; place-items: center; border: none; border-radius: 6px; background: none; color: var(--p-nav); cursor: pointer; }
.p-tree-toggle:hover { background: var(--p-line-soft); }
.p-tree-toggle:focus-visible { outline: 2px solid var(--p-accent); }
.p-tree-pad { width: 26px; flex-shrink: 0; display: inline-grid; place-items: center; }
.p-sched th.gantt, .p-sched td.gantt { width: 22%; min-width: 200px; }
.p-gantt { position: relative; display: block; height: 18px; border-radius: 4px; background: repeating-linear-gradient(to left, transparent 0 24px, #EEF1F6 24px 25px); }
.p-gantt .today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #E04848; z-index: 2; }
.p-gantt .bar { position: absolute; top: 4px; height: 10px; border-radius: 3px; background: #A9C4EE; overflow: hidden; }
.p-gantt .bar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: #1F6FD1; }
.p-gantt .bar.wbs { top: 6px; height: 6px; background: #8A97AB; }
.p-gantt .bar.wbs i { background: var(--p-nav); }
.p-gantt .bar.crit { background: #F5B5B5; }
.p-gantt .bar.crit i { background: #E04848; }
.p-gantt .bar.late { background: #F8D3A6; }
.p-gantt .bar.late i { background: #E8962E; }
.p-gantt .ms { position: absolute; top: 3px; width: 12px; height: 12px; margin-inline-start: -6px; transform: rotate(45deg); background: #6B4FBB; }
.p-gantt .ms.done { background: #1F9D55; }
.p-gantt .ms.late { background: #E04848; }

/* ── sign-in over the tower photo (Login.razor), after the user's two references: glass card on the right, brand block on
   the left, gold corner accents, footer line. The photo sits on its own layer so it can be made more vivid. ── */
.p-signin {
    position: fixed; inset: 0; overflow: auto; isolation: isolate; background: #0A1B36;
    display: flex; align-items: center; gap: clamp(24px, 5vw, 80px); padding: 40px clamp(16px, 6vw, 110px) 72px;
}
.p-signin::before { content: ""; position: fixed; inset: 0; z-index: -2; background: url('img/login-tower.jpg') center 40% / cover no-repeat; filter: saturate(1.25) contrast(1.08) brightness(1.04); }
.p-signin::after { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(ellipse 30% 55% at 19.5% 50%, rgba(10, 27, 54, .5), transparent 75%), linear-gradient(90deg, rgba(10, 27, 54, .5) 0%, rgba(10, 27, 54, .12) 45%, transparent 62%), linear-gradient(0deg, rgba(10, 27, 54, .45) 0%, transparent 22%); }
.p-signin-corner { position: fixed; z-index: -1; width: 240px; height: 240px; pointer-events: none; }
.p-signin-corner.start { top: 0; left: 0; background: linear-gradient(135deg, rgba(15, 42, 79, .85) 0 30%, transparent 30%), linear-gradient(135deg, transparent 0 33%, var(--p-accent) 33% 34.2%, transparent 34.2%); }
.p-signin-corner.end { bottom: 0; right: 0; background: linear-gradient(315deg, rgba(15, 42, 79, .85) 0 26%, transparent 26%), linear-gradient(315deg, transparent 0 29%, var(--p-accent) 29% 30.4%, transparent 30.4%); }

/* the card: clear glass, a faint navy tint and text shadows keep the white words readable over a bright sky */
.p-signin-card {
    position: relative; flex: 0 0 auto; width: 100%; max-width: 370px; padding: 30px 28px 26px; border-radius: 22px; color: #FFFFFF;
    background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04)), rgba(10, 27, 54, .28);
    -webkit-backdrop-filter: blur(8px) saturate(1.3); backdrop-filter: blur(8px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, .42); box-shadow: 0 24px 60px rgba(4, 12, 28, .3); text-shadow: 0 1px 6px rgba(4, 12, 28, .5);
}
.p-signin-card h1 { margin: 0; text-align: center; font-size: 30px; font-weight: 300; letter-spacing: .3px; color: #FFFFFF; }
.p-signin-sub { margin: 6px 0 0; text-align: center; font-size: 15px; color: #F0F4F9; }
.p-signin-diamond { display: flex; align-items: center; gap: 12px; margin: 16px auto 22px; width: 78%; }
.p-signin-diamond::before, .p-signin-diamond::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--p-accent)); }
.p-signin-diamond::after { background: linear-gradient(270deg, transparent, var(--p-accent)); }
.p-signin-diamond i { width: 10px; height: 10px; transform: rotate(45deg); background: var(--p-accent); }
.p-shell .p-signin-card .mud-input-outlined { background: rgba(10, 27, 54, .3); border-radius: 12px; }
.p-signin-card .mud-input-outlined-border { border-color: rgba(255, 255, 255, .6) !important; border-radius: 12px !important; }
.p-signin-card .mud-input-control:hover .mud-input-outlined-border { border-color: rgba(255, 255, 255, .85) !important; }
.p-signin-card .mud-input.mud-input-outlined.mud-focused .mud-input-outlined-border { border-color: var(--p-accent) !important; }
.p-signin-card .mud-input, .p-signin-card .mud-input-slot { color: #FFFFFF !important; }
.p-signin-card .mud-input-label { color: #FFFFFF !important; font-weight: 700; }
.p-signin-card .mud-input-label-outlined { background: transparent !important; }
.p-signin-card .mud-input-label-outlined.mud-input-label-inputcontrol { text-shadow: 0 0 6px rgba(10, 27, 54, .9); }
/* the field's icon in its own segment, as in the reference */
.p-signin-card .mud-input-adornment-start { margin-inline-end: 10px; padding: 4px 0; padding-inline-end: 12px; border-inline-end: 1px solid rgba(255, 255, 255, .35); }
.p-signin-card .mud-input-adornment .mud-icon-root { color: #FFFFFF; }
.p-signin-card input:-webkit-autofill { -webkit-text-fill-color: #FFFFFF; -webkit-box-shadow: 0 0 0 40px rgba(10, 27, 54, .6) inset; caret-color: #FFFFFF; transition: background-color 9999s; }
.p-signin-card .p-remember { color: #FFFFFF; }
.p-signin-card .p-remember input { accent-color: var(--p-accent); }
.p-signin-card .p-caps { color: #FFD08A; }
.p-signin-card .p-notice.error { background: rgba(224, 72, 72, .85); color: #FFFFFF; }
.p-signin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.p-signin-row .p-link-btn { color: #FBD81C; font-size: 14px; }
.p-signin-hint { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; background: rgba(255, 255, 255, .16); color: #FFFFFF; }
.p-signin-hint[hidden] { display: none; }
.p-signin-go {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; margin-top: 20px; border: none; border-radius: 14px; cursor: pointer;
    font: inherit; font-size: 19px; font-weight: 700; color: #111111; text-shadow: none;
    background: #FBD81C; box-shadow: 0 8px 22px rgba(251, 216, 28, .28);
}
.p-signin-go:hover { background: #FFE24D; }
.p-signin-go:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.p-signin-go .go { display: inline-flex; align-items: center; gap: 8px; }
.p-signin-go .busy, form.sending .p-signin-go .go { display: none; }
form.sending .p-signin-go .busy { display: inline; }
form.sending .p-signin-go { opacity: .8; pointer-events: none; }
.p-pass { position: relative; }
.p-pass-eye {
    position: absolute; top: 50%; inset-inline-end: 8px; transform: translateY(-50%); z-index: 1; width: 36px; height: 36px; display: grid; place-items: center;
    border: none; border-radius: 8px; background: none; color: #E4EAF1; cursor: pointer;
}
.p-pass-eye:hover { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.p-pass-eye:focus-visible { outline: 2px solid var(--p-accent); }
.p-pass-eye .hide, .p-pass-eye[aria-pressed="true"] .show { display: none; }
.p-pass-eye[aria-pressed="true"] .hide { display: inline-block; }
/* user names and passwords are Latin: typed left to right (the labels stay Arabic, on the right); the password keeps room for the eye on the left */
.p-signin-card input[name="username"], .p-signin-card input[name="password"] { direction: ltr; text-align: left; }
.p-signin-card .p-pass input[name="password"].mud-input-root { padding-left: 44px !important; }
.p-caps { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 13px; font-weight: 600; color: #B54708; }
.p-caps[hidden] { display: none; }

/* the brand block: light logo, name between gold rules, the line, five values with gold icons */
.p-signin-brand { position: fixed; top: 0; bottom: 0; left: 0; width: 39vw; padding: 0 16px 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: #FFFFFF; text-shadow: 0 2px 14px rgba(4, 12, 28, .55); }
.p-signin-brand img { width: 200px; height: auto; margin-bottom: 6px; filter: drop-shadow(0 4px 14px rgba(4, 12, 28, .45)); }
.p-signin-brand h2 { margin: 0; font-size: clamp(36px, 3.8vw, 56px); font-weight: 300; letter-spacing: .5px; line-height: 1.2; color: #FFFFFF; }
.p-signin-rules { display: flex; align-items: center; gap: 14px; margin: 4px 0 0; font-size: clamp(20px, 2vw, 28px); font-weight: 400; color: #FBD81C; }
.p-signin-rules span { width: 56px; height: 2px; background: var(--p-accent); }
.p-signin-line { margin: 14px 0 0; font-size: clamp(20px, 1.8vw, 26px); font-weight: 300; color: #FFFFFF; }
.p-signin-brand .p-signin-diamond { width: min(420px, 90%); margin: 18px auto; }
.p-signin-values { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.p-signin-values li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 clamp(14px, 2vw, 30px); font-size: 17px; font-weight: 400; line-height: 1.3; }
.p-signin-values li + li { border-inline-start: 1px solid rgba(251, 216, 28, .5); }
.p-signin-values .mud-icon-root { font-size: 36px; color: #FBD81C; filter: drop-shadow(0 2px 6px rgba(4, 12, 28, .5)); }

.p-signin-foot { position: fixed; bottom: 18px; left: clamp(16px, 3vw, 40px); display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: #F0F4F9; text-shadow: 0 1px 6px rgba(4, 12, 28, .6); }
.p-signin-foot .sep { width: 1px; height: 18px; background: rgba(255, 255, 255, .5); }
.p-signin-foot span { display: inline-flex; align-items: center; gap: 6px; }
.p-signin-foot .mud-icon-root { color: #FBD81C; }

@media (max-width: 1100px) {
    .p-signin-values li { padding: 0 10px; font-size: 13px; }
    .p-signin-values .mud-icon-root { font-size: 28px; }
}
@media (max-width: 860px) {
    .p-signin { flex-direction: column-reverse; justify-content: flex-end; gap: 22px; padding: 28px 16px 90px; }
    .p-signin::before { background-image: url('img/login-tower-tall.jpg'); background-position: center top; }
    .p-signin::after { background: linear-gradient(180deg, rgba(10, 27, 54, .5) 0%, transparent 32%, transparent 68%, rgba(10, 27, 54, .45) 100%); }
    .p-signin-corner { width: 130px; height: 130px; }
    .p-signin-brand { position: static; width: auto; padding: 0; flex: none; }
    .p-signin-brand img { width: 140px; }
    .p-signin-brand h2 { font-size: 32px; }
    .p-signin-rules { font-size: 19px; }
    .p-signin-line { margin-top: 8px; font-size: 16px; }
    .p-signin-brand .p-signin-diamond, .p-signin-values { display: none; }
    .p-signin-card { max-width: none; padding: 26px 20px 24px; }
    .p-signin-card h1 { font-size: 26px; }
    .p-signin-foot { left: 0; right: 0; justify-content: center; flex-wrap: wrap; font-size: 12px; }
}

/* waiting after «دخول»: the sign-in and the first dashboard take a few seconds - a full-page veil with the logo and a spinner
   stays until the next page arrives (Login.razor [data-wait], shown by app.js on submit) */
.p-signin-wait { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    background: rgba(10, 27, 54, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #FFFFFF; text-align: center; }
.p-signin-wait[hidden] { display: none; }
.p-signin-wait img { width: 180px; height: auto; animation: p-wait-pulse 1.6s ease-in-out infinite; }
.p-signin-wait .ring { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .2); border-top-color: var(--p-accent); animation: p-wait-spin .9s linear infinite; }
.p-signin-wait b { font-size: 18px; font-weight: 700; }
.p-signin-wait span { font-size: 14px; color: #D5DDE8; }
@keyframes p-wait-spin { to { transform: rotate(360deg); } }
@keyframes p-wait-pulse { 50% { opacity: .7; transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) { .p-signin-wait img, .p-signin-wait .ring { animation-duration: 3s; } }
.p-signin-go .busy { align-items: center; gap: 8px; }
.p-signin-go .busy::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(17, 17, 17, .25); border-top-color: #111111; animation: p-wait-spin .8s linear infinite; }
form.sending .p-signin-go .busy { display: inline-flex; }

/* ── consultant stage (ConsultantStage.razor, phase 4.1): send confirmation and reissue on CIR / MAR ── */
.p-stage-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.p-stage-field { display: flex; flex-direction: column; gap: 8px; }
.p-stage-field .label { font-size: 13.5px; font-weight: 700; color: var(--p-ink); }
.p-stage-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.p-approve-head .mud-button-root { margin-inline-start: auto; flex-shrink: 0; }

/* ── requests for information (RfiDetails.razor, phase 4.2) ── */
.p-rfi-cancel { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.p-rfi-cancel .grow { flex: 1; }
.portal-dl dd.neg { color: #C23434; }

/* ── correspondence (phase 4.3): recipients rows, upload button, task rows with their tools ── */
.p-recipient { display: flex; align-items: center; gap: 8px; }
.p-recipient .grow { flex: 1; min-width: 0; }
.p-checks-row { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.p-upload { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px dashed var(--p-line); border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--p-primary); }
.p-upload:hover { border-color: var(--p-accent); background: var(--p-accent-soft); }
.p-task-row { display: flex; align-items: center; }
.p-task-row > a { flex: 1; min-width: 0; }
.p-task-row .p-row-tools { padding-inline-end: 12px; }

/* ── specification library (SpecRegister / SpecDetails, phase 4.4): the cross-book search, the sections tree beside the text ── */
.p-spec-search { display: flex; align-items: center; gap: 10px; }
.p-spec-search .grow { flex: 1; }
.p-spec-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .p-spec-layout { grid-template-columns: minmax(0, 1fr); } }
.p-spec-tree { list-style: none; margin: 0; padding: 6px 0; max-height: 70vh; overflow: auto; }
.p-spec-tree li button { width: 100%; display: flex; align-items: center; gap: 6px; padding: 7px 12px 7px 8px; border: none; background: none; cursor: pointer; font: inherit; text-align: start; color: var(--p-ink); border-radius: 6px; }
.p-spec-tree li button:hover { background: var(--p-line-soft); }
.p-spec-tree li.on button { background: var(--p-accent-soft); box-shadow: inset -3px 0 0 var(--p-accent); font-weight: 700; }
.p-spec-tree .no { color: var(--p-accent-dark); font-weight: 700; flex-shrink: 0; }
.p-spec-tree .p-chip { margin-inline-start: auto; }

/* ── bills of quantities (phase 6.1): section rows of the item table, note lines, rate-only items, takeoff lines ── */
.p-boq tr.p-boq-section { background: #F3F6FA; }
.p-boq tr.p-boq-section td { padding-top: 10px; padding-bottom: 10px; color: var(--p-nav); }
.p-boq tr.p-boq-section.depth-0 { background: #E8EEF6; }
.p-boq tr.p-boq-section.depth-0 td { border-top: 2px solid var(--p-line); }
.p-boq tr.p-boq-section:hover { background: #FFFBE5; }
.p-boq tr.p-boq-section .mud-icon-root { vertical-align: middle; color: var(--p-muted); }
.p-boq tr.p-boq-note td { font-size: 13px; color: var(--p-muted); font-style: italic; white-space: pre-wrap; }
.p-boq tr.p-boq-rateonly td { color: var(--p-muted); }
.p-boq tfoot td { padding: 13px 16px; font-weight: 800; color: var(--p-ink); border-top: 2px solid var(--p-nav); }
.p-lines-mini { background: #FBFCFE; border: 1px solid var(--p-line-soft); border-radius: 8px; }
.p-lines-mini th, .p-lines-mini td { padding: 7px 10px !important; font-size: 13px; }

/* ── owner contract and executive IPC (phase 6.2) ── */
.p-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .p-cols-2 { grid-template-columns: minmax(0, 1fr); } }
.p-pre { white-space: pre-line; }
.p-warn { color: #B54708; }
.p-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.p-chip-button {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--p-line);
    background: var(--p-surface); color: var(--p-text); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.p-chip-button em { font-style: normal; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--p-line-soft); color: var(--p-muted); text-align: center; }
.p-chip-button.on { background: var(--p-primary); border-color: var(--p-primary); color: #fff; }
.p-chip-button.on em { background: rgba(255, 255, 255, .2); color: #fff; }
.p-chip-button:focus-visible, .p-link-button:focus-visible { outline: 2px solid var(--p-primary); outline-offset: 2px; }
.p-link-button { border: none; background: none; padding: 0; font: inherit; color: var(--p-ink); text-align: start; cursor: pointer; }
.p-link-button:hover { color: var(--p-primary); text-decoration: underline; }
.p-cell-input {
    width: 96px; padding: 5px 8px; border: 1px solid #E8C95A; border-radius: 6px; background: #FFFCEB; font: inherit; font-size: 14px;
    direction: ltr; text-align: right; font-variant-numeric: tabular-nums;
}
.p-cell-input.wide { width: 100%; min-width: 110px; direction: rtl; text-align: start; border-color: var(--p-line); background: var(--p-surface); }
.p-cell-input:focus { outline: 2px solid var(--p-primary); outline-offset: 0; border-color: transparent; }
/* a cell that opens a search dialog (a subcontract line's owner item, budget line) */
.p-cell-pick { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 180px; max-width: 320px; padding: 5px 8px; border: 1px solid var(--p-line); border-radius: 6px; background: var(--p-surface); font: inherit; font-size: 13px; color: inherit; text-align: start; cursor: pointer; }
.p-cell-pick span { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.35; }
.p-cell-pick .mud-icon-root { flex: none; color: var(--p-muted); }
.p-cell-pick.none { color: var(--p-muted); }
.p-cell-pick:hover { border-color: var(--p-primary); }
.p-cell-pick:focus-visible { outline: 2px solid var(--p-primary); outline-offset: 0; }
.p-pick-search { display: flex; width: 100%; margin-bottom: 10px; }
.p-pick-list { height: min(55vh, 460px); overflow-y: auto; border: 1px solid var(--p-line); border-radius: 8px; }
.p-pick-row { display: block; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--p-line-soft); background: transparent; font: inherit; font-size: 13.5px; color: inherit; text-align: start; line-height: 1.45; cursor: pointer; }
.p-pick-row:hover, .p-pick-row.active { background: #F1F6FD; }
.p-pick-row.selected { box-shadow: inset -3px 0 0 var(--p-primary); }
.p-pick-row.clear { color: var(--p-muted); }
.p-pick-row .c { font-weight: 700; margin-left: 8px; }   /* dir="ltr" on the number: a logical margin would fall on the wrong side */
.p-pick-row .n { display: block; font-size: 12px; color: var(--p-muted); }
.p-pick-count { margin-top: 8px; font-size: 12.5px; }
.p-pick-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.p-pick-tools .grow { flex: 1; }
.p-pick-budget { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.p-pick-budget select { max-width: 340px; }
.p-pick-row.check { display: flex; align-items: flex-start; gap: 10px; }
.p-pick-row.check input { flex: none; margin-top: 4px; width: 16px; height: 16px; }
.p-pick-row.check .b { flex: 1; min-width: 0; }
.p-pick-row.taken { color: var(--p-muted); cursor: default; }
/* what a subcontract line still misses, before any save */
.p-lines-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 18px; background: #FFF8E6; border-bottom: 1px solid #F0DDA8; font-size: 13.5px; }
.p-lines-check > span { flex: 1; min-width: 200px; }
.p-sc-lines tr.p-line-bad td:first-child { box-shadow: inset -3px 0 0 #E8962E; }
/* SCDISC: the line discount typed as an amount or a percent; the contract-wide discount bar */
.p-sc-disc-cell { white-space: nowrap; }
.p-sc-disc-cell .p-cell-input { width: 96px; display: inline-block; }
.p-sc-disc-cell .p-cell-input.pct { width: 58px; margin-inline-start: 4px; }
.p-sc-discount { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--p-line-soft); background: #F8FAFD; }
/* SCLOOK: long descriptions and owner items take three lines (the full text on hover); the header stays while the lines scroll */
.p-sc-lines .sc-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.p-sc-lines .sc-clamp1 { display: -webkit-box !important; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.p-sc-lines td.p-wrap { min-width: 220px; max-width: 360px; }
.p-grid-edit-wrap:has(> .p-sc-lines) { max-height: 70vh; overflow: auto; }
.p-sc-lines thead th { position: sticky; top: 0; z-index: 2; }
.p-sc-lines tbody tr:hover td { background: #FFFBE5; }
.p-line-flag { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-inline-start: 5px; border-radius: 50%; background: #E8962E; color: #fff; font-size: 11px; font-weight: 700; cursor: help; }
#sc-editor { scroll-margin-top: 84px; }
.p-eipc tr.p-eipc-overrun td:first-child { box-shadow: inset -3px 0 0 #C23434; }
.p-eipc tr.p-eipc-open td { background: #FFFBE5; }
.p-eipc tr.p-eipc-detail td { background: #FBFCFE; padding-top: 14px; padding-bottom: 14px; }
.p-eipc-wrap { container-type: inline-size; }
.p-eipc tr.p-eipc-detail td > .p-eipc-panel { position: sticky; inset-inline-start: 12px; width: calc(100cqi - 40px); max-width: 920px; }

/* ── phase 6.6-A: cost control, cash flow, commitments ── */
.p-usage { display: inline-block; width: 110px; height: 8px; border-radius: 4px; background: #EEF1F5; overflow: hidden; vertical-align: middle; margin-inline-end: 8px; }
.p-usage > span { display: block; height: 100%; border-radius: 4px; }
.p-cf td.cell { cursor: pointer; }
.p-cf td.cell:hover { background: #EEF4FF; }
.p-cf td.cell.on { outline: 2px solid var(--p-nav); outline-offset: -2px; }
.p-cf td.past { background: #FAFAFA; }
.p-cf th.now { color: var(--p-nav); }
.p-cf tr.total td { font-weight: 800; background: #F5F7FA; }
.p-cf tr.total td.gap { background: #FFEBEB; }
.p-cf th:first-child, .p-cf td:first-child { position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; min-width: 220px; }
.p-cf tr.total td:first-child { background: #F5F7FA; }
.p-defs { margin: 0; padding: 14px 18px 14px 18px; padding-inline-start: 34px; color: var(--p-muted); line-height: 1.9; }
.p-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; color: var(--p-muted); font-size: 13px; }
.p-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-inline-end: 6px; }

/* ── phase 6.6-B: budgets, transfers, forecast, claims ── */
.p-table td.p-adjusted { background: #FFF8E1; }
/* an amount above its ceiling: said under the field (the button stays disabled) instead of being cut silently */
.p-field-error { color: var(--t-rejected-fg); font-size: 12.5px; font-weight: 600; margin: -4px 4px 8px; }

/* «طباعة» / «Excel» of a register (phase 7.3, ReportActions.razor) */
.p-report-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* the reports center's date filters (phase 7.3-C, ReportsCenter.razor) */
.p-date-filter { display: inline-flex; align-items: center; gap: 6px; color: var(--p-muted); font-size: 13px; }
.p-date-filter .p-select { min-width: 0; }

/* ── The home page, redesign phase 1 (2026-11-03, identity v2): PortalHome, AiBriefCard, AskEtmam ── */
.h-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; }
.h-bar-hello { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.h-bar-hello h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--p-primary); }
.h-bar-hello span { display: inline-flex; align-items: center; gap: 6px; color: var(--p-muted); font-size: 13.5px; }
.h-bar-ask { flex: 1 1 280px; max-width: 560px; margin-inline-start: auto; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px;
    border: 1px solid #CBD5E1; border-radius: 10px; background: #FBFBFF; }
.h-bar-ask:focus-within { border-color: var(--p-ai); box-shadow: 0 0 0 3px var(--p-ai-soft); }
.h-bar-ask .spark { color: var(--p-ai); }
.h-bar-ask input { flex: 1; min-width: 0; border: none; outline: none; background: none; font: inherit; font-size: 14.5px; color: var(--p-ink); }

.h-ai-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.h-ai-brief, .h-ask { background: var(--p-surface); border: 1px solid var(--p-line); border-inline-start: 4px solid var(--p-ai); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.h-ai-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.h-ai-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--p-ai-ink); }
.h-ai-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--p-ai-soft); color: var(--p-ai); }
.h-ai-meta { margin-inline-start: auto; color: var(--p-muted); font-size: 12.5px; }
.h-ai-refresh { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--p-line); border-radius: 8px; background: none; color: var(--p-action); font: inherit; font-size: 13px; padding: 4px 10px; cursor: pointer; }
.h-ai-refresh:hover { background: var(--p-action-soft); }
.h-ai-refresh:disabled { opacity: .5; cursor: default; }
.h-ai-headline { margin: 10px 0 8px; font-size: 15px; font-weight: 600; color: var(--p-ink); line-height: 1.6; }
.h-ai-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.h-ai-col { border-radius: 10px; padding: 10px 12px; }
.h-ai-col .t { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.h-ai-col .x { font-size: 13.5px; line-height: 1.65; }
.h-ai-col.decide { background: #FCEBEB; color: #791F1F; }
.h-ai-col.risk { background: #FAEEDA; color: #633806; }
.h-ai-col.good { background: #E1F5EE; color: #085041; }
.h-ai-actions { margin: 10px 0 0; padding-inline-start: 22px; color: var(--p-ink); font-size: 13.5px; line-height: 1.7; }
.h-ai-foot { margin-top: 8px; color: var(--p-muted); font-size: 12px; }
.h-ai-foot .model { margin-inline-start: 8px; direction: ltr; unicode-bidi: isolate; }
.h-ai-note { margin-top: 10px; display: flex; align-items: center; gap: 6px; color: var(--p-muted); font-size: 13.5px; }
.h-ai-note.warn { background: var(--p-ai-soft); color: var(--p-ai-ink); border-radius: 8px; padding: 8px 10px; }
.h-ai-skeleton { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.h-ai-skeleton span { height: 74px; border-radius: 10px; background: linear-gradient(90deg, var(--p-line-soft), var(--p-ai-soft), var(--p-line-soft)); background-size: 200% 100%; animation: h-shimmer 1.4s infinite linear; }
@keyframes h-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.h-ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.h-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #D6D2F7; background: var(--p-ai-soft); color: var(--p-ai-ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; text-align: start; }
.h-chip:hover { border-color: var(--p-ai); }
.h-ask-thread { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; margin: 12px 0; padding-inline-end: 4px; }
.h-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.h-msg.me { align-self: flex-start; background: var(--p-action-soft); color: var(--p-ink); }
.h-msg.ai { align-self: flex-end; background: var(--p-ai-soft); color: var(--p-ai-ink); }
.h-msg.typing { display: flex; gap: 4px; }
.h-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--p-ai); animation: h-dot 1s infinite ease-in-out; }
.h-msg.typing span:nth-child(2) { animation-delay: .15s; }
.h-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes h-dot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.h-ask-sources { color: var(--p-muted); font-size: 12px; }
.h-ask-form { display: flex; gap: 8px; }
.h-ask-input { flex: 1; min-width: 0; height: 42px; border: 1px solid #CBD5E1; border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--p-ink); }
.h-ask-input:focus { outline: none; border-color: var(--p-ai); box-shadow: 0 0 0 3px var(--p-ai-soft); }
.h-ask-send { width: 42px; height: 42px; border: none; border-radius: 10px; background: var(--p-ai); color: #fff; display: grid; place-items: center; cursor: pointer; }
.h-ask-send:disabled { opacity: .45; cursor: default; }

.h-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.h-kpi { display: block; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; padding: 14px 16px; color: var(--p-text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.h-kpi:hover { border-color: #C3D2E6; box-shadow: 0 6px 18px -12px rgba(11, 31, 58, .45); }
.h-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.h-kpi-top .l { color: var(--p-muted); font-size: 13.5px; font-weight: 600; }
.h-kpi-top .i { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.h-kpi-top .i.blue { background: var(--p-action-soft); color: var(--p-action); }
.h-kpi-top .i.gold { background: var(--p-accent-soft); color: var(--p-accent-dark); }
.h-kpi-top .i.red { background: #FCEBEB; color: #B91C1C; }
.h-kpi-top .i.green { background: #E1F5EE; color: #15803D; }
.h-kpi-top .i.amber { background: #FAEEDA; color: #B45309; }
.h-kpi .v { margin-top: 2px; font-size: 28px; font-weight: 700; color: var(--p-primary); line-height: 1.2; }
.h-kpi .v.neg { color: #B91C1C; }
.h-kpi .h { margin-top: 4px; color: var(--p-muted); font-size: 12.5px; }
.h-bar-track { position: relative; height: 6px; border-radius: 3px; background: var(--p-line); margin-top: 8px; }
.h-bar-track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 3px; background: var(--p-action); }
.h-bar-track u { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--p-primary); }
.h-bar-track.mini { width: 72px; height: 5px; margin-top: 4px; }

.h-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-bottom: 18px; align-items: start; }
.h-grid.single { grid-template-columns: minmax(0, 1fr); }
.h-count { background: var(--p-accent); color: var(--p-accent-ink); border-radius: 999px; padding: 0 9px; font-size: 12.5px; font-weight: 700; }
.h-table { width: 100%; border-collapse: collapse; }
.h-table th { background: #F8FAFC; color: var(--p-muted); font-size: 12.5px; font-weight: 600; text-align: start; padding: 9px 14px; border-bottom: 1px solid var(--p-line); white-space: nowrap; }
.h-table td { padding: 9px 14px; border-bottom: 1px solid var(--p-line-soft); font-size: 13.5px; vertical-align: middle; }
.h-table tbody tr:hover td { background: #F8FAFC; }
.h-table td.muted { color: var(--p-muted); }
.h-doc { display: flex; align-items: center; gap: 10px; color: var(--p-ink); text-decoration: none; min-width: 0; }
.h-doc-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--p-action-soft); color: var(--p-action); flex-shrink: 0; }
.h-doc-main { display: flex; flex-direction: column; min-width: 0; }
.h-doc-main b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.h-doc-main bdi { color: var(--p-muted); font-size: 12px; }
.h-doc:hover b { color: var(--p-action); }
.h-wait { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.h-wait.red { background: #FCEBEB; color: #791F1F; }
.h-wait.amber { background: #FAEEDA; color: #633806; }
.h-wait.green { background: #E1F5EE; color: #085041; }

.h-health { list-style: none; margin: 0; padding: 0; }
.h-health a { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--p-line-soft); color: var(--p-ink); text-decoration: none; }
.h-health a:hover { background: #F8FAFC; }
.h-health .n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.h-health .n b { font-weight: 600; font-size: 13.5px; }
.h-health .n small { color: var(--p-muted); font-size: 12px; }
.h-health .dots { display: flex; gap: 5px; }
.h-health .dots i, .h-health-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.h-health .pct { display: flex; flex-direction: column; align-items: flex-end; width: 76px; font-size: 13.5px; }
.h-health i.green, .h-health-legend i.green { background: #15803D; }
.h-health i.amber, .h-health-legend i.amber { background: #D97706; }
.h-health i.red, .h-health-legend i.red { background: #B91C1C; }
.h-health i.gray { background: #CBD5E1; }
.h-health-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 16px; color: var(--p-muted); font-size: 12px; }
.h-health-legend span { display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 1100px) { .h-ai-grid, .h-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
    .h-ai-cols, .h-ai-skeleton { grid-template-columns: minmax(0, 1fr); }
    .h-bar-ask { max-width: none; margin-inline-start: 0; }
    .h-doc-main b { max-width: 160px; }
}

/* ── Redesigned registers, phase 2 (2026-11-03): StatusFilters, DocCell, StatusDot, DueBadge, AiInsightPanel, .r-table ── */
.r-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.r-ai-btn.mud-button-root { border-color: #D6D2F7; background: var(--p-ai-soft); color: var(--p-ai-ink); }
.r-ai-btn.mud-button-root:hover { background: #E3E0FD; }
.r-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.r-filter { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--p-line); background: var(--p-surface);
    color: var(--p-text); font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.r-filter b { font-weight: 700; color: var(--p-primary); }
.r-filter .mud-icon-root { font-size: 18px; }
.r-filter.tone-blue .mud-icon-root { color: var(--p-action); }
.r-filter.tone-amber .mud-icon-root { color: #B45309; }
.r-filter.tone-green .mud-icon-root { color: #15803D; }
.r-filter.tone-orange .mud-icon-root { color: #C2410C; }
.r-filter.tone-gray .mud-icon-root { color: var(--p-muted); }
.r-filter.tone-navy .mud-icon-root { color: var(--p-primary); }
.r-filter.tone-red { background: #FEF2F2; border-color: #F7C1C1; color: #791F1F; }
.r-filter.tone-red .mud-icon-root, .r-filter.tone-red b { color: #B91C1C; }
.r-filter:hover { border-color: #C3D2E6; }
.r-filter.on { background: var(--p-primary); border-color: var(--p-primary); color: #fff; }
.r-filter.on b, .r-filter.on .mud-icon-root { color: var(--p-accent); }
.r-filter:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 1px; }

.r-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.r-layout.with-ai { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); }
.r-ai { background: var(--p-surface); border: 1px solid var(--p-line); border-inline-start: 4px solid var(--p-ai); border-radius: 12px; padding: 14px 16px; position: sticky; top: 78px; }
.r-ai-close { margin-inline-start: auto; border: none; background: none; color: var(--p-muted); cursor: pointer; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; }
.r-ai-close:hover { background: var(--p-line-soft); }
.r-ai-meta { margin-top: 4px; color: var(--p-muted); font-size: 12.5px; }
.r-ai-q { margin-top: 10px; display: flex; align-items: center; gap: 6px; color: var(--p-ai-ink); font-weight: 600; font-size: 13.5px; }
.r-ai-text { margin: 6px 0 0; color: var(--p-text); font-size: 13.5px; line-height: 1.75; white-space: pre-line; }
.h-ai-skeleton.one { grid-template-columns: minmax(0, 1fr); }

.r-table { width: 100%; border-collapse: collapse; }
.r-table th { position: sticky; top: 0; z-index: 1; background: #F8FAFC; color: var(--p-muted); font-size: 12.5px; font-weight: 600; text-align: start;
    padding: 10px 12px; border-bottom: 1px solid var(--p-line); white-space: nowrap; }
.r-table td { padding: 10px 12px; border-bottom: 1px solid var(--p-line-soft); font-size: 13.5px; vertical-align: middle; color: var(--p-text); }
.r-table tbody tr { transition: background .1s; }
.r-table tbody tr:hover td { background: #F8FAFC; }
.r-table tbody tr.clickable { cursor: pointer; }
.r-table td.muted { color: var(--p-muted); }
.r-table td.nowrap { white-space: nowrap; }
.r-table td.doc { min-width: 260px; }
.r-proj { display: inline-block; background: #F1F5F9; color: var(--p-text); border-radius: 6px; padding: 2px 8px; font-size: 12.5px; white-space: nowrap; }
.r-person { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.r-person i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--p-primary-soft); color: var(--p-primary); font-style: normal; font-size: 11.5px; font-weight: 700; }

.r-doc { display: flex; align-items: center; gap: 10px; color: var(--p-ink); text-decoration: none; min-width: 0; }
.r-doc-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--p-action-soft); color: var(--p-action); flex-shrink: 0; }
.r-doc-main { display: flex; flex-direction: column; min-width: 0; }
.r-doc-main b { font-weight: 600; font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.r-doc-main small { color: var(--p-muted); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.r-doc:hover b { color: var(--p-action); }

.r-dot { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; font-weight: 600; }
.r-dot i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.r-dot.tone-green { color: #166534; } .r-dot.tone-green i { background: #16A34A; }
.r-dot.tone-amber { color: #854D0E; } .r-dot.tone-amber i { background: #D97706; }
.r-dot.tone-orange { color: #9A3412; } .r-dot.tone-orange i { background: #EA580C; }
.r-dot.tone-red { color: #991B1B; } .r-dot.tone-red i { background: #DC2626; }
.r-dot.tone-blue { color: #1E4E8C; } .r-dot.tone-blue i { background: #2563EB; }
.r-dot.tone-violet { color: var(--p-ai-ink); } .r-dot.tone-violet i { background: var(--p-ai); }
.r-dot.tone-gray { color: #475569; } .r-dot.tone-gray i { background: #94A3B8; }

.r-due { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.r-due.tone-red { background: #FCEBEB; color: #791F1F; }
.r-due.tone-amber { background: #FAEEDA; color: #633806; }
.r-due.tone-gray { color: var(--p-muted); font-weight: 400; padding-inline: 0; }

@media (max-width: 1150px) { .r-layout.with-ai { grid-template-columns: minmax(0, 1fr); } .r-ai { position: static; } }
/* phones: each row becomes a card - the cells stack, the captions come from data-label */
@media (max-width: 640px) {
    .r-table thead { display: none; }
    .r-table, .r-table tbody, .r-table tr, .r-table td { display: block; width: 100%; }
    .r-table tr { border-bottom: 1px solid var(--p-line); padding: 8px 4px; }
    .r-table td { border: none; padding: 4px 10px; }
    .r-table td[data-label]::before { content: attr(data-label) "  "; color: var(--p-muted); font-size: 12px; font-weight: 400; }
    .r-table td.doc { min-width: 0; }
    .r-grid-wrap { min-width: 0 !important; }
}

/* ── Redesign phase 2-B (2026-11-03): KpiCard as a compact tile everywhere (40 screens) - the label on top, the figure under it,
   a smaller tinted icon; six fit in a row on a wide screen; a card used as a filter (.p-kpi-button.on) is outlined in navy. ── */
.p-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.p-kpis.six, .p-kpis.seven { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.p-kpi { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--p-line); gap: 10px; align-items: flex-start; box-shadow: none; }
.p-kpi .txt { gap: 1px; }
.p-kpi .label { order: -1; font-size: 13px; font-weight: 600; color: var(--p-muted); }
.p-kpi .value { font-size: clamp(20px, 1.7vw, 26px); color: var(--p-primary); }
.p-kpi .value.is-date { font-size: 17px; white-space: nowrap; overflow-wrap: normal; line-height: 1.5; }   /* Fmt.Date: a date never breaks across lines in a narrow card */
.p-kpi .hint { font-size: 12px; }
.p-kpi .ico { width: 38px; height: 38px; }
.p-kpi .ico .mud-icon-root { font-size: 20px; }
a.p-kpi:hover { border-color: #C3D2E6; }
.p-kpi-button:hover .p-kpi { border-color: #C3D2E6; }
.p-kpi-button.on .p-kpi { border-color: var(--p-primary); background: var(--p-primary-soft); box-shadow: 0 0 0 1px var(--p-primary); }
@media (max-width: 1000px) { .p-kpis.six { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
@media (max-width: 560px) { .p-kpis, .p-kpis.six, .p-kpis.seven { grid-template-columns: repeat(2, minmax(0, 1fr)); } .p-kpi .ico { display: none; } }
.r-doc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 44px 0 0; }
.r-doc-tags span { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--p-muted); }
.r-doc-tags span .mud-icon-root { font-size: 14px; }
.r-doc-tags .act { background: #FAEEDA; color: #633806; border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.r-table td.num { direction: ltr; unicode-bidi: isolate; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.r-table tfoot td { padding: 10px 12px; background: #F8FAFC; font-weight: 700; color: var(--p-primary); border-top: 1px solid var(--p-line); }
/* EXECTBL: the subcontracts register - grouped headers, a warning tone, the contract column kept in view */
.r-table thead tr.groups th { text-align: center; color: var(--p-ink); font-weight: 700; }
.r-table thead tr.groups th[rowspan] { text-align: start; vertical-align: bottom; }
.r-table th.center, .r-table td.center { text-align: center; }
.r-table th.g-start, .r-table td.g-start { border-inline-start: 1px solid var(--p-line); }
.r-table td.r-warn { color: #B4650F; font-weight: 700; }
.r-table tfoot td.title { white-space: nowrap; }
.r-contracts .p-progress { min-width: 120px; }
.r-contracts tbody td:nth-child(2) { min-width: 170px; }
@media (max-width: 700px) { .r-table.r-contracts { min-width: 0 !important; } .r-contracts tbody td:nth-child(2) { min-width: 0; } }
@media (min-width: 701px) { .r-table.p-sticky-first tbody tr:hover td:first-child { background: #F8FAFC; } .r-table.p-sticky-first thead tr:first-child th:first-child { z-index: 3; } }
@media (max-width: 700px) { .r-table tfoot, .r-table tfoot tr, .r-table tfoot td { display: block; width: 100%; } .r-table tfoot td[data-label=""]::before { content: none; } .r-table td.g-start { border: none; } }

/* ── Document pages, redesign phase 3 (2026-11-03): DocHeader, DocWorkspace, DocSideCard, DocAiSummary, .d-facts ── */
.d-head { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.d-back { display: inline-flex; align-items: center; gap: 4px; color: var(--p-muted); font-size: 13px; text-decoration: none; margin-bottom: 6px; }
.d-back:hover { color: var(--p-action); }
.d-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.d-head-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--p-action-soft); color: var(--p-action); flex-shrink: 0; }
.d-head-main { flex: 1 1 260px; min-width: 0; }
.d-head-main h1 { margin: 0; font-size: 20px; font-weight: 700; color: var(--p-primary); line-height: 1.4; }
.d-head-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; color: var(--p-muted); font-size: 13px; }
.d-num { font-weight: 600; color: var(--p-text); }
.d-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.d-ws { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 14px; align-items: start; }
.d-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.d-main > * { margin: 0 !important; }
.d-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 78px; min-width: 0; }
.d-card { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.d-card.accent-action { border-top: 3px solid var(--p-action); }
.d-card-title { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14.5px; font-weight: 700; color: var(--p-primary); }
.d-card-title .mud-icon-root { color: var(--p-action); }
.d-card-title.ai, .d-card-title.ai .mud-icon-root { color: var(--p-ai-ink); }
.d-card .p-card, .d-card .portal-card { border: none; box-shadow: none; padding: 0; margin: 0; }
.d-card .p-card + .p-card { margin-top: 10px; }   /* «الإجراء المطلوب»: the approve row, then the document's own actions */
.d-ai { border-inline-start: 4px solid var(--p-ai); }
.d-ai-hint { margin: 0 0 8px; color: var(--p-muted); font-size: 13px; line-height: 1.6; }
.d-ai-headline { margin: 0 0 6px; font-weight: 600; color: var(--p-ink); font-size: 14px; line-height: 1.6; }
.d-ai-run { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #D6D2F7; background: var(--p-ai-soft); color: var(--p-ai-ink);
    border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.d-ai-run:hover { border-color: var(--p-ai); }
.d-link { border: none; background: none; color: var(--p-action); font: inherit; font-size: 12px; cursor: pointer; padding: 0 4px; }

.d-facts { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.d-facts > div { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; }
.d-facts dt { flex: 0 0 110px; color: var(--p-muted); }
.d-facts dd { flex: 1; margin: 0; text-align: right; color: var(--p-primary); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 1150px) {
    .d-ws { grid-template-columns: minmax(0, 1fr); }
    .d-side { position: static; order: -1; }
}

/* the action card says so when nothing in it rendered (its components draw nothing when the user has no step) */
.d-none-note { display: none; margin: 0; color: var(--p-muted); font-size: 13px; }
.d-card-title + .d-none-note { display: block; }
.d-card .p-card-head, .d-card .portal-card h2 { padding: 0; }

/* ── Forms, redesign 3-C (2026-11-03): FormSection, FormSaveBar, «قراءة إتمام» (AiDocReader) ── */
.f-sec-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.f-sec-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--p-primary); }
.f-sec-head p { margin: 2px 0 0; color: var(--p-muted); font-size: 12.5px; line-height: 1.6; }
.f-sec-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--p-primary); color: #fff; font-size: 13px; font-weight: 700; }
.f-sec-no.icon { background: var(--p-action-soft); color: var(--p-action); }
.f-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    margin-top: 14px; padding: 10px 14px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; box-shadow: 0 -6px 18px rgba(11, 31, 58, .08); }
.f-bar-note { color: var(--p-muted); font-size: 13px; min-width: 0; }
.f-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.f-ai-file { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 8px; margin-bottom: 8px; border-radius: 8px;
    background: var(--p-ai-soft); color: var(--p-ai-ink); font-size: 12.5px; overflow-wrap: anywhere; }
.f-ai-read > div { align-items: flex-start; }
.f-ai-again { display: inline-block; position: relative; margin-top: 6px; }
label.d-ai-run { position: relative; }
@media (max-width: 600px) {
    .f-bar { border-radius: 0; margin-inline: -16px; }
    .f-bar-actions { width: 100%; }
    .f-bar-actions .mud-button-root { flex: 1 1 auto; }
}
.f-tips { margin: 0; padding-inline-start: 18px; color: var(--p-ink); font-size: 13px; line-height: 1.8; }
@media (max-width: 1150px) { .d-card.f-wide-only { display: none; } }

/* ── users, phase 7.4-A (2026-11-03): a role assignment, its scopes, the effective permissions by section ── */
.u-role { border: 1px solid var(--p-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.u-role.off { opacity: .7; background: var(--p-bg); }
.u-role-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.u-role-name { font-weight: 700; color: var(--p-primary); border-inline-start: 4px solid var(--p-action); padding-inline-start: 8px; }
.u-scopes { margin: 0; display: grid; gap: 4px; }
.u-scopes > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; font-size: 13.5px; }
.u-scopes dt { color: var(--p-muted); }
.u-scopes dd { margin: 0; overflow-wrap: anywhere; }
.u-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.u-sections summary { display: grid; grid-template-columns: minmax(0, 1fr) 140px 74px; align-items: center; gap: 10px; cursor: pointer; padding: 6px 4px; border-radius: 8px; }
.u-sections summary:hover { background: var(--p-bg); }
.u-sec-name { font-weight: 600; color: var(--p-ink); }
.u-sec-count { text-align: right; color: var(--p-muted); font-size: 13px; }
.u-bar { height: 6px; border-radius: 3px; background: var(--p-line); overflow: hidden; }
.u-bar i { display: block; height: 100%; background: var(--p-action); }
.u-items { margin: 4px 0 8px; padding-inline-start: 22px; columns: 2; column-gap: 24px; font-size: 13px; line-height: 1.8; }
@media (max-width: 700px) {
    .u-items { columns: 1; }
    .u-sections summary { grid-template-columns: minmax(0, 1fr) 70px 54px; }
    .u-scopes > div { grid-template-columns: 90px minmax(0, 1fr); }
}

/* ── roles, phase 7.4-B (2026-11-03): the matrix's screens and actions, the role comparison ── */
.u-count { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.u-count .u-bar { width: 70px; }
.u-screens { list-style: none; margin: 4px 0 10px; padding: 0 8px; display: grid; gap: 6px; }
.u-screens > li { color: var(--p-muted); }
.u-screens > li.on { color: var(--p-ink); }
.u-screen { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.u-screens > li.on .u-screen .mud-icon-root { color: #15803D; }
.u-acts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 26px 0 0; }
.u-act { font-size: 12px; padding: 1px 8px; border-radius: 6px; border: 1px dashed var(--p-line); color: var(--p-muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.u-act.on { border-style: solid; border-color: #BFE3C9; background: #F0FAF3; color: #166534; text-decoration: none; }
.u-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.u-pick .p-select { flex: 1 1 220px; }
.u-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.u-cmp h3 { margin: 0 0 6px; font-size: 13.5px; color: var(--p-primary); }
.u-cmp ul { margin: 0; padding-inline-start: 18px; font-size: 13px; line-height: 1.8; }
@media (max-width: 700px) { .u-cmp { grid-template-columns: 1fr; } }

/* ── settings, phase 7.5-A (2026-11-03): the section list beside the section's page ── */
.s-ws { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.s-nav { display: flex; flex-direction: column; gap: 2px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; padding: 8px; position: sticky; top: 78px; }
.s-nav a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--p-ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.s-nav a:hover { background: var(--p-bg); }
.s-nav a.on { background: var(--p-action-soft); color: var(--p-action); }
.s-nav-note { display: flex; gap: 6px; padding: 8px 10px 4px; margin-top: 6px; border-top: 1px solid var(--p-line); color: var(--p-muted); font-size: 12px; line-height: 1.6; }
.s-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.s-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.s-status li { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--p-line); }
.s-status li:last-child { border-bottom: none; }
.s-cap { color: var(--p-muted); }
.s-desk { font-size: 12px; }
.s-deadlines td { vertical-align: middle; }
.s-deadlines td small { display: block; }
.s-deadlines .mud-input-control { max-width: 120px; margin: 0; }
.s-type b { display: block; color: var(--p-primary); }
.s-key { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.s-usage { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.s-usage b { font-size: 18px; color: var(--p-primary); }
.s-limit { width: 180px; }
.s-usage-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.s-usage-cols h3 { margin: 0 0 6px; font-size: 13.5px; color: var(--p-primary); }
.s-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.s-rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: baseline; }
.s-rank small { color: var(--p-muted); }
@media (max-width: 900px) {
    .s-ws { grid-template-columns: minmax(0, 1fr); }
    .s-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .s-nav-note { width: 100%; }
    .s-usage-cols { grid-template-columns: 1fr; }
    .s-status li { grid-template-columns: minmax(0, 1fr) auto; }
    .s-status .s-cap { grid-column: 1 / -1; }
}

/* ── work calendars, phase 7.5-B (2026-11-03): the calendars, the standard week, the month view ── */
.c-cals { display: flex; flex-wrap: wrap; gap: 8px; }
.c-cal { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 190px; padding: 10px 12px; border: 1px solid var(--p-line);
    border-radius: 10px; background: var(--p-surface); font: inherit; text-align: start; cursor: pointer; }
.c-cal:hover { border-color: var(--p-action); }
.c-cal.on { border-color: var(--p-action); background: var(--p-action-soft); }
.c-cal b { color: var(--p-primary); }
.c-cal small { color: var(--p-muted); font-size: 12px; }
.c-cal.add { flex-direction: row; align-items: center; color: var(--p-action); border-style: dashed; min-width: 0; }
.c-default { position: absolute; top: 8px; inset-inline-end: 10px; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: #FBF4E4; color: #7A5A16; }
.c-week { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.c-week .label { color: var(--p-muted); font-size: 13px; margin-inline-end: 4px; }
.c-day { padding: 5px 11px; border-radius: 8px; border: 1px solid var(--p-line); background: var(--p-surface); color: var(--p-muted); font: inherit; font-size: 13px; cursor: pointer; }
.c-day.on { background: var(--p-action-soft); border-color: #BBD0EA; color: var(--p-action); font-weight: 700; }
.c-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.c-desc { flex: 1 1 240px; }
.c-month { border: 1px solid var(--p-line); border-radius: 12px; padding: 8px 10px 10px; max-width: 520px; }
.c-month-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.c-month-head b { flex: 1; text-align: center; color: var(--p-primary); }
.c-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.c-dow { text-align: center; font-size: 11.5px; color: var(--p-muted); padding-bottom: 2px; }
.c-cell { display: inline-grid; place-items: center; min-height: 34px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-size: 13px; cursor: pointer; background: var(--p-surface); }
button.c-cell:hover { border-color: var(--p-action); }
.c-cell.work { background: #F6F9FD; color: var(--p-ink); }
.c-cell.rest { background: #F1F1EE; color: #9A9890; }
.c-cell.holiday { background: #FCEBEB; color: #8A1F1F; font-weight: 700; }
.c-cell.extra { background: #E8F5EC; color: #166534; font-weight: 700; }
.c-cell.today { border-color: var(--p-primary); }
.c-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--p-muted); }
.c-legend .c-cell { width: 16px; min-height: 16px; height: 16px; border-radius: 4px; cursor: default; }
.c-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.c-range .mud-input-control { max-width: 180px; margin: 0; }
.c-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.c-list li { display: grid; grid-template-columns: 16px minmax(150px, auto) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--p-line); font-size: 13.5px; }
.c-list .c-cell { width: 16px; min-height: 16px; height: 16px; border-radius: 4px; cursor: default; }
@media (max-width: 600px) { .c-list li { grid-template-columns: 16px minmax(0, 1fr) auto; } .c-list .c-what { grid-column: 2 / 3; } .c-cal { min-width: 0; flex: 1 1 140px; } }

/* ── help center, phase 7.5-C (2026-11-03): modules, guides, the side (ask, statuses, shortcuts) ── */
.hc-search { margin-bottom: 12px; }
.hc-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 14px; }
.hc-module { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--p-line);
    border-radius: 10px; background: var(--p-surface); text-decoration: none; color: var(--p-ink); }
.hc-module .mud-icon-root { grid-row: span 2; color: var(--p-action); }
.hc-module b { color: var(--p-primary); font-size: 14px; }
.hc-module small { color: var(--p-muted); font-size: 12px; line-height: 1.5; }
.hc-module:hover, .hc-module.on { border-color: var(--p-action); background: var(--p-action-soft); }
.hc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 14px; align-items: start; }
.hc-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hc-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 78px; min-width: 0; }
.hc-article { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; padding: 0 14px; }
.hc-article[open] { border-color: #BBD0EA; }
.hc-article summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 0; cursor: pointer; list-style: none; }
.hc-article summary::-webkit-details-marker { display: none; }
.hc-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--p-action-soft); color: var(--p-action); }
.hc-title b { display: block; color: var(--p-primary); }
.hc-title small { color: var(--p-muted); font-size: 12.5px; line-height: 1.6; }
.hc-steps { margin: 0 0 8px; padding-inline-start: 22px; line-height: 1.9; font-size: 14px; }
.hc-tips { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: 13px; color: #7A5A16; }
.hc-tips li { display: flex; gap: 6px; align-items: flex-start; }
.hc-actions { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
.hc-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hc-status li { display: grid; gap: 2px; }
.hc-status small { color: var(--p-muted); font-size: 12px; }
.hc-kbd { font-family: inherit; font-size: 12px; padding: 2px 6px; border: 1px solid var(--p-line); border-bottom-width: 2px; border-radius: 6px; background: var(--p-bg); white-space: nowrap; }
@media (max-width: 1100px) { .hc-layout { grid-template-columns: minmax(0, 1fr); } .hc-side { position: static; } }

/* ── sidebar redesign (2026-11-03): folding sections, favourites, filter, the compact rail; active = blue wash + gold line ── */
.p-sidebar .mud-drawer-content { gap: 10px; overflow-x: hidden; }
.p-sidebar .p-nav { gap: 1px; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.p-nav-tools { display: flex; align-items: center; gap: 6px; }
.p-nav-filter { flex: 1; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; background: rgba(255, 255, 255, .07); color: #A9B7CB; }
.p-nav-filter input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: #FFFFFF; font: inherit; font-size: 13.5px; }
.p-nav-filter input::placeholder { color: #8FA0B8; }
.p-nav-filter:focus-within { outline: 1px solid rgba(201, 162, 78, .6); }
.p-nav-fold { width: 34px; height: 34px; display: grid; place-items: center; border: none; border-radius: 9px; background: transparent; color: #AEBBD0; cursor: pointer; }
.p-nav-fold:hover { background: rgba(255, 255, 255, .08); color: #FFFFFF; }
.p-nav-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 8px 6px; }
.p-nav-section { padding: 10px 12px 3px; }
.p-nav-empty { padding: 10px 12px; color: #8FA0B8; font-size: 13px; }
.p-nav-row { position: relative; display: flex; align-items: center; }
.p-nav-row .p-nav-item { flex: 1; min-width: 0; padding: 8px 12px; font-size: 14px; gap: 10px; }
.p-nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-nav-text small { display: block; font-size: 11px; font-weight: 400; color: #8FA0B8; }
.p-nav-item.active { background: rgba(30, 78, 140, .55); color: #FFFFFF; box-shadow: inset -3px 0 0 var(--p-accent); }
.p-nav-item.active .mud-icon-root { color: var(--p-accent); }
.p-nav-star { position: absolute; inset-inline-end: 6px; width: 26px; height: 26px; display: grid; place-items: center; border: none; border-radius: 7px; background: transparent;
    color: #7F90A9; cursor: pointer; opacity: 0; transition: opacity .12s; }
.p-nav-row:hover .p-nav-star, .p-nav-star:focus-visible, .p-nav-star.on { opacity: 1; }
.p-nav-star.on { color: var(--p-accent); }
.p-nav-row:hover .p-nav-count { margin-inline-end: 26px; }
.p-nav-group { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: none; border-radius: 9px; background: transparent;
    color: var(--p-nav-ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-align: start; }
.p-nav-group span { flex: 1; }
.p-nav-group .mud-icon-root { color: #AEBBD0; }
.p-nav-group:hover { background: rgba(255, 255, 255, .06); }
.p-nav-group.current { color: #FFFFFF; }
.p-nav-group.current > .mud-icon-root:first-child { color: var(--p-accent); }
.p-nav-chev { transition: transform .15s; }
.p-nav-group.open .p-nav-chev { transform: rotate(180deg); }
.p-nav-sub { margin: 1px 22px 6px 0; padding-inline-start: 6px; border-inline-start: 2px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 1px; }
.p-nav-sub .p-nav-item { font-weight: 600; font-size: 13.5px; color: #C3CEDD; }
.p-nav-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .08); }
.p-sidebar-foot { display: none; }

/* the compact rail */
.p-sidebar.rail .mud-drawer-content { padding: 0 6px 12px; align-items: center; }
.p-sidebar.rail .p-brand { padding: 16px 0 12px; margin: 0 -6px; width: calc(100% + 12px); }
.p-sidebar.rail .p-brand-logo { width: 44px; }
.p-sidebar.rail .p-brand-sub, .p-sidebar.rail .p-new-text { display: none; }
.p-sidebar.rail .p-new-btn { width: 44px; height: 40px; padding: 0; }
.p-sidebar.rail .p-new-menu { width: auto; }
.p-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.p-rail-item { position: relative; width: 44px; height: 40px; display: grid; place-items: center; border: none; border-radius: 9px; background: transparent; color: #AEBBD0; cursor: pointer; text-decoration: none; }
.p-rail-item:hover { background: rgba(255, 255, 255, .08); color: #FFFFFF; }
.p-rail-item.active { background: rgba(30, 78, 140, .55); color: var(--p-accent); box-shadow: inset -3px 0 0 var(--p-accent); }
.p-rail-count { position: absolute; top: 2px; inset-inline-start: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #E24B4A; color: #fff; font-size: 10px; display: grid; place-items: center; }
.p-rail-sep { width: 30px; height: 1px; background: rgba(255, 255, 255, .1); margin: 6px 0; }
.p-rail-expand { margin-top: auto; }
.p-fly-head { padding: 8px 16px 4px; font-weight: 700; color: var(--p-primary); font-size: 13px; }
/* MudBlazor sets the drawer width once (--mud-drawer-width-right on the layout); the rail overrides it on desktop only */
@media (min-width: 960px) {
    .p-shell.rail { --mud-drawer-width-right: 68px !important; }
    .p-shell.rail .p-sidebar.mud-drawer { width: 68px !important; }
}
.p-nav-full { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; width: 100%; }
.p-rail { display: none; }
@media (min-width: 960px) {
    .p-shell.rail .p-rail { display: flex; }
    .p-shell.rail .p-nav-full { display: none; }
}
@media (max-width: 959.98px) {
    .p-nav-fold { display: none; }
    .p-sidebar.rail .mud-drawer-content { padding: 0 12px 16px; align-items: stretch; }
    .p-sidebar.rail .p-brand { padding: 22px 6px 18px; margin: 0 -12px; width: auto; }
    .p-sidebar.rail .p-brand-logo { width: 150px; }
    .p-sidebar.rail .p-brand-sub, .p-sidebar.rail .p-new-text { display: initial; }
    .p-sidebar.rail .p-new-btn { width: 100%; height: auto; padding: 9px 14px; }
    .p-sidebar.rail .p-new-menu { width: 100%; }
}

/* ── sign-in over the towers, organised after the user's reference (2026-11-05) ── */
.gl { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; color: #FFFFFF; }
.gl-bg { position: fixed; inset: 0; z-index: -2; background: url('img/login-towers.webp') center / cover no-repeat #0B1F3A; }
.gl-bg::after { content: ""; position: absolute; inset: 0;
    background: linear-gradient(to left, rgba(8, 20, 40, .62), rgba(8, 20, 40, .18) 38%, rgba(8, 20, 40, 0) 60%), linear-gradient(to bottom, rgba(8, 20, 40, .6), rgba(8, 20, 40, 0) 22%); }
.gl-wave { position: fixed; inset: auto 0 0 0; z-index: -1; width: 100%; height: clamp(90px, 21vh, 200px); }
.gl-top { display: flex; align-items: flex-start; justify-content: center; gap: 24px; padding: 22px clamp(16px, 4vw, 64px) 0; }
/* three lines at one spacing: logo, Arabic, English; at the far right of the page, in the dark sky above the cranes */
.gl-brand { --gl-brand-gap: 8px; position: fixed; right: clamp(16px, 4vw, 64px); top: 22px; display: flex; flex-direction: column; align-items: center; gap: var(--gl-brand-gap); color: #FFFFFF; text-decoration: none; }
.gl-brand img { display: block; width: clamp(80px, 7vw, 130px); height: auto; filter: drop-shadow(0 3px 10px rgba(4, 12, 28, .4)); }   /* the block's sizes follow the photo's width */
.gl-brand .name { display: flex; flex-direction: column; align-items: center; gap: var(--gl-brand-gap); text-align: center; line-height: 1.2; text-shadow: 0 1px 3px rgba(4, 12, 28, .95), 0 0 12px rgba(4, 12, 28, .8); }
.gl-brand .name b { font-size: clamp(13px, 1.25vw, 24px); font-weight: 600; white-space: nowrap; }
.gl-brand .name bdi { font-size: clamp(9.5px, .78vw, 15px); font-weight: 600; white-space: nowrap; color: var(--p-accent); }   /* the colour of «دخول» */
.gl-brand .name .line { position: relative; display: inline-block; padding-bottom: 10px; font-size: clamp(12px, 1.1vw, 21px); font-weight: 500; white-space: nowrap; }   /* the last line of the block, on its axis */
.gl-brand .name .line::after { content: ""; position: absolute; inset-inline: 10%; bottom: 0; height: 6px; border-top: 2px solid var(--p-accent); border-radius: 50% 50% 0 0; }
.gl-main { display: flex; align-items: center; justify-content: center; padding: 16px clamp(16px, 4vw, 64px); }
.gl-card { flex: 0 1 350px; width: 100%; padding: 44px 28px 46px; border-radius: 22px; background: rgba(11, 31, 58, .14);
    -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, .28); box-shadow: 0 24px 60px -18px rgba(4, 12, 28, .7), inset 0 1px 0 rgba(255, 255, 255, .22); }
.gl-logo { display: block; width: 150px; height: auto; margin: 0 auto 22px; }
.gl-card h1 { margin: 0; text-align: center; font-size: 25px; font-weight: 700; color: #FFFFFF; }
.gl-sub { margin: 8px 0 30px; text-align: center; font-size: 14.5px; color: #E4EAF1; }
.gl-error { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: #FFFFFF;
    background: rgba(194, 52, 52, .72); border: 1px solid rgba(255, 255, 255, .25); }
.gl-card .mud-input-outlined { background: rgba(255, 255, 255, .12); border-radius: 12px; }
.gl-card .mud-input-outlined-border { border-color: rgba(255, 255, 255, .38) !important; border-radius: 12px !important; }
.gl-card .mud-input-control:hover .mud-input-outlined-border { border-color: rgba(255, 255, 255, .7) !important; }
.gl-card .mud-input.mud-input-outlined.mud-focused .mud-input-outlined-border { border-color: var(--p-accent) !important; }
.gl-card .mud-input-slot, .gl-card .mud-input > input { color: #FFFFFF; caret-color: #FFFFFF; }
.gl-card input::placeholder, .gl-card .mud-input > input.mud-input-root::placeholder { color: #E4EAF1 !important; opacity: 1 !important; direction: rtl; text-align: right; }
.gl-card input[name="username"], .gl-card input[name="password"] { direction: ltr; text-align: left; }
.gl-card input[name="username"].mud-input-root { padding-left: 16px !important; }
.gl-card input:-webkit-autofill { -webkit-text-fill-color: #FFFFFF; caret-color: #FFFFFF; transition: background-color 9999s ease-out; box-shadow: 0 0 0 40px rgba(11, 31, 58, .55) inset; }
.gl-card .mud-input-adornment .mud-icon-root { color: #E4EAF1; }
.gl-card .p-pass input[name="password"].mud-input-root { padding-left: 50px !important; }
.gl-card .p-caps { color: #FFD08A; }
.gl-card .p-signin-go { margin-top: 24px; height: 50px; border-radius: 12px; font-size: 17px; color: var(--p-accent-ink); background: var(--p-accent); box-shadow: 0 10px 22px -12px rgba(4, 12, 28, .7); }
.gl-card .p-signin-go:hover { color: #FFFFFF; background: var(--p-accent-dark); }
.gl-card .p-signin-go .busy::before { border-color: rgba(11, 31, 58, .25); border-top-color: var(--p-accent-ink); }
.gl-card .p-remember { color: #FFFFFF; }
.gl-card .p-remember input { accent-color: var(--p-accent); }
.gl-card .p-signin-row .p-link-btn { color: #FFFFFF; font-weight: 600; }
.gl-foot { padding: 0 clamp(16px, 4vw, 64px) 12px; text-align: start; font-size: 12.5px; color: #FFFFFF; text-shadow: 0 1px 5px rgba(4, 12, 28, .95); }
@media (max-height: 720px) and (min-width: 861px) {
    .gl-top { padding-top: 12px; }
    .gl-brand { --gl-brand-gap: 6px; }
    .gl-main { padding-top: 8px; padding-bottom: 8px; }
    .gl-card { padding: 18px 28px 18px; }
    .gl-logo { width: 104px; margin-bottom: 6px; }
    .gl-card h1 { font-size: 22px; }
    .gl-sub { margin-bottom: 12px; }
    .gl-card .p-signin-go { margin-top: 12px; height: 44px; }
}
@media (max-width: 860px) {
    .gl-bg { background-position: 46% center; }
    .gl-bg::after { background: rgba(8, 20, 40, .34); }
    /* the phone layout the user approved (2026-11-05): the card alone over the photo, no header, no wave */
    .gl-top, .gl-wave { display: none; }
    .gl { grid-template-rows: 1fr auto; }
    .gl-main { justify-content: center; padding: 28px 6vw; }
    /* as the user approved it: wider and less clear than on a computer */
    .gl-card { flex-basis: 400px; padding: 24px 20px 22px; background: rgba(11, 31, 58, .42);
        -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
    .gl-logo { margin-bottom: 14px; }
    .gl-sub { margin-bottom: 20px; }
    .gl-card .p-signin-go { margin-top: 18px; }
    .gl-foot { padding: 0 16px 14px; text-align: center; font-size: 13px; }
}

/* «الجدول الزمني» project list (/portal/schedule) */
.sp-list { list-style: none; margin: 0; padding: 0; }
.sp-list li + li { border-top: 1px solid var(--p-line-soft); }
.sp-list a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--p-ink); text-decoration: none; }
.sp-list a:hover { background: var(--p-action-soft); }
.sp-list a > .mud-icon-root:first-child { color: var(--p-action); }
.sp-list .n { font-weight: 600; }
.sp-list .c { color: var(--p-muted); font-size: 13px; direction: ltr; text-align: right; }
.sp-list .go { margin-inline-start: auto; color: var(--p-muted); }

/* «مكتبة الموارد وقوالب التحليل» (/portal/pricing/library): the category tree beside the table */
.rl-split { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.rl-tree { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.rl-tree ul { list-style: none; margin: 0; padding: 0; }
.rl-tree > ul { padding: 6px 8px 10px; }
.rl-node { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.rl-node.on { background: var(--p-action-soft); }
.rl-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px 6px; border: none; background: none; color: var(--p-ink); font: inherit; font-size: 13.5px; text-align: start; cursor: pointer; border-radius: 6px; }
.rl-pick:hover { background: var(--p-line-soft); }
.rl-node.on .rl-pick { color: var(--p-action); font-weight: 700; }
.rl-pick .c { color: var(--p-muted); font-size: 12px; }
.rl-pick em { margin-inline-start: auto; font-style: normal; font-size: 12px; color: var(--p-muted); }
.rl-off td { color: var(--p-muted); }
@media (max-width: 960px) { .rl-split { grid-template-columns: minmax(0, 1fr); } .rl-tree { position: static; max-height: 320px; } }

/* «التسعير والتقدير» (/portal/pricing): cost by resource type, section rows, the estimate's figures */
.pr-stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--p-line-soft); margin-bottom: 10px; }
.pr-stack i { display: block; height: 100%; }
.pr-types { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13.5px; color: var(--p-text); }
.pr-types li { display: inline-flex; align-items: center; gap: 6px; }
.pr-types i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pr-types b { color: var(--p-ink); }
.p-table tr.pr-sec td { background: var(--p-primary-soft); color: var(--p-primary); font-weight: 700; }
.pr-defs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 24px; margin: 0; }
.pr-defs > div { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--p-line-soft); }
.pr-defs dt { flex: 0 0 130px; color: var(--p-muted); font-size: 13px; }
.pr-defs dd { flex: 1; margin: 0; text-align: right; color: var(--p-primary); }
.pr-compare-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--p-line-soft); }
.pr-clamp { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* planning writes (web plan P3): the action rows, the import's steps */
.pl-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.si-steps { list-style: none; display: flex; gap: 8px; margin: 0 0 14px; padding: 0; flex-wrap: wrap; }
.si-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--p-line-soft); color: var(--p-muted); font-weight: 700; }
.si-steps li b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--p-surface); }
.si-steps li.on { background: var(--p-action-soft); color: var(--p-action); }
.si-pick { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.si-pick label:not(.p-upload) { display: flex; flex-direction: column; gap: 4px; }
.si-file { display: inline-flex; align-items: center; gap: 6px; }
.si-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; }
.si-map label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.si-map .p-select { width: 100%; min-width: 0; }
.si-confirm { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 700; }
.p-upload.disabled { opacity: .55; pointer-events: none; }
.p-notice.success { background: var(--t-approved-bg); color: var(--t-approved-fg); }

/* «تحديث التقدم» (/portal/planning/progress) */
.pu-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
.pu-bar label { display: flex; flex-direction: column; gap: 4px; }
.pu-sum { flex: 1; font-weight: 700; color: var(--p-ink); }
.pu-in { width: 100%; min-width: 120px; padding: 6px 8px; border: 1px solid var(--p-line); border-radius: 8px; font: inherit; background: var(--p-surface); color: var(--p-ink); }
.pu-in.num { min-width: 80px; max-width: 100px; text-align: end; direction: ltr; }
.pu-in:focus { outline: 2px solid var(--p-action); outline-offset: -1px; border-color: transparent; }
.pu-table tr.pu-changed td { background: var(--p-accent-soft); }
.pu-table tr.pu-bad td { background: var(--t-rejected-bg); }

/* the item analysis editor (RateAnalysisEditor, web plan R3-A) */
.ra .p-card-head { flex-wrap: wrap; }
.ra-nav { display: inline-flex; gap: 2px; margin-inline-start: auto; }
.ra-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--p-line-soft); }
.ra-pick { position: relative; flex: 1 1 320px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--p-line); border-radius: 9px; padding: 0 10px; background: var(--p-surface); }
.ra-pick input { flex: 1; border: none; outline: none; padding: 8px 0; font: inherit; background: transparent; color: var(--p-ink); }
.ra-hits { position: absolute; z-index: 20; inset-inline: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 4px; max-height: 300px; overflow: auto; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 10px; box-shadow: 0 12px 30px -12px rgba(11, 31, 58, .35); }
.ra-hits li { padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.ra-hits li:hover { background: var(--p-action-soft); }
.ra-hits .c { color: var(--p-muted); font-size: 12px; }
.ra-table td { vertical-align: top; }
.ra-foot { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--p-line-soft); }
.ra-item { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
.ra-item label, .ra-pct { display: flex; flex-direction: column; gap: 4px; }
.ra-check { flex-direction: row !important; align-items: center; gap: 6px !important; font-weight: 700; }
.ra-save { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* the price offer's terms and history (web plan R3-B) */
.qo-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
.qo-form .qo-wide { grid-column: 1 / -1; }
.qo-history { margin: 12px 0 0; padding-inline-start: 18px; color: var(--p-text); font-size: 13px; line-height: 1.8; }

/* library edits (web plan R3-C) */
.rl-form { padding: 12px 16px 14px; border-bottom: 1px solid var(--p-line-soft); background: var(--p-accent-soft); }
.rl-form h3 { margin: 0 0 10px; font-size: 15px; }
.rl-form .qo-form label { display: flex; flex-direction: column; gap: 4px; }
.rl-catbar { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--p-line-soft); }

/* planning look-ahead / delays (web plan P4) */
.p-kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .p-kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.p-table tr.group td { background: var(--p-accent-soft); padding-top: 8px; padding-bottom: 8px; }

/* purchase requests register: the desktop's tools in the web's quiet identity (2026-11-04) */
.prl-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.prl-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; align-items: center; text-align: start; background: var(--p-surface, #fff); border: 1px solid var(--p-line-soft); border-radius: 10px;
  padding: 10px 14px; cursor: pointer; font: inherit; color: inherit; }
.prl-card:hover { border-color: var(--p-line); }
.prl-card.on { border-color: var(--p-accent, #2F6FB5); box-shadow: inset 0 -2px 0 var(--p-accent, #2F6FB5); }
.prl-card .n { font-size: 20px; font-weight: 700; line-height: 1.2; }
.prl-card.alert .n { color: #C23434; }
.prl-card .l { grid-column: 1; font-size: 12.5px; color: var(--p-muted); }
.prl-card .i { grid-column: 2; grid-row: 1 / span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
@media (max-width: 760px) { .prl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.prl-search { flex: 1 1 240px; }
.prl-bar .p-select { max-width: 240px; }
.prl-bar-end { margin-inline-start: auto; }
.prl-more { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--p-line-soft); border-radius: 10px; }
.prl-f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--p-muted); }
.prl-pop-host { position: relative; }
.prl-pop { position: absolute; top: calc(100% + 4px); inset-inline-start: 0; z-index: 31; min-width: 170px; background: var(--p-surface, #fff); border: 1px solid var(--p-line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px 10px; }
.prl-pop label { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.prl-card-table { position: relative; overflow: visible; }
.prl-th { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.prl-sort { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.prl-funnel { background: none; border: 0; cursor: pointer; padding: 2px; color: var(--p-muted); border-radius: 4px; display: inline-flex; opacity: 0; }
.prl-table th:hover .prl-funnel, .prl-funnel:focus-visible, .prl-funnel.on { opacity: 1; }
.prl-funnel.on { color: var(--p-accent, #2F6FB5); }
@media (hover: none) { .prl-funnel { opacity: 1; } }
.prl-scrim { position: fixed; inset: 0; z-index: 30; }
.prl-menu { position: absolute; top: 44px; inset-inline-start: 12px; z-index: 31; width: 280px; background: var(--p-surface, #fff); border: 1px solid var(--p-line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px; }
.prl-menu-title { font-weight: 600; margin-bottom: 6px; }
.prl-menu .p-select { width: 100%; margin-bottom: 6px; }
.prl-menu label { display: flex; align-items: center; gap: 6px; padding: 3px 2px; font-size: 13px; cursor: pointer; }
.prl-menu label em { margin-inline-start: auto; color: var(--p-muted); font-style: normal; font-size: 12px; }
.prl-menu-all { border-bottom: 1px solid var(--p-line-soft); margin-bottom: 4px; }
.prl-menu-list { max-height: 240px; overflow-y: auto; }
.prl-menu-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.prl-doc { min-width: 280px; }
.prl-no { font-weight: 600; font-size: 13px; }
.prl-purpose { color: var(--p-muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prl-act { white-space: nowrap; width: 1%; text-align: end; }
.prl-tool { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

/* the one date field (DayField) */
.p-dayfield { position: relative; display: inline-flex; align-items: center; width: 170px; height: 40px; border: 1px solid var(--p-line); border-radius: 8px; background: var(--p-surface); flex: none; }
.p-dayfield:focus-within { border-color: var(--p-action); box-shadow: 0 0 0 1px var(--p-action); }
.p-dayfield.bad { border-color: #C23434; box-shadow: 0 0 0 1px #C23434; }
.p-dayfield.off { opacity: .6; }
.p-dayfield input { flex: 1; min-width: 0; height: 100%; padding: 0 10px; border: 0; outline: 0; background: none; font: inherit; color: var(--p-ink); direction: rtl; text-align: right; }
.p-dayfield button { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--p-muted); cursor: pointer; }
.p-dayfield button:hover:not(:disabled) { background: var(--p-line-soft); color: var(--p-ink); }
.p-dayfield button:focus-visible { outline: 2px solid var(--p-action); }
.p-dayfield .cal { margin-inline-end: 4px; }
td .p-dayfield { width: 134px; }   /* a row of them must fit the table without sideways scrolling, the date whole */
td .p-dayfield input { padding: 0 3px; }
td .p-dayfield button { width: 24px; height: 24px; }
td .p-dayfield .cal { margin-inline-end: 2px; }
.p-dayfield-cal { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.p-date-filter { white-space: nowrap; }
.pu-asof, .rl-form .qo-form .rl-day { display: flex; flex-direction: column; gap: 4px; }

/* ── editing roles and access, phase 7.4-C ── */
.a-form h3 { margin: 0 0 10px; font-size: 15px; color: var(--p-primary); }
.a-inset { padding: 12px 16px; border-bottom: 1px solid var(--p-line); background: var(--p-bg); }
.a-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.a-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--p-muted); }
.a-field.grow { flex: 1 1 220px; }
.a-field .p-select { width: 100%; }
.a-field-check { padding-bottom: 9px; }
.a-notes { height: auto; padding: 8px 10px; resize: vertical; font: inherit; color: var(--p-ink); }
.a-check { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--p-ink); cursor: pointer; }
.a-scopes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .a-scopes { grid-template-columns: minmax(0, 1fr); } }
.a-sub { margin: 10px 0 6px; font-size: 13.5px; color: var(--p-primary); }
.a-search { margin-bottom: 6px; }
.a-list { display: grid; gap: 3px; max-height: 210px; overflow-y: auto; padding: 6px 8px; border: 1px solid var(--p-line); border-radius: 8px; }
.a-perms { max-height: 240px; margin-bottom: 10px; }
.a-stores { max-height: 280px; overflow-y: auto; border: 1px solid var(--p-line); border-radius: 8px; }
.a-actions { display: flex; gap: 8px; margin-top: 12px; }
.a-sec-tools { display: flex; gap: 14px; padding: 4px 8px; }
.a-act { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.a-act input { margin: 0; }
.a-role-tools { display: inline-flex; gap: 12px; margin-inline-start: auto; }
.p-link-btn.a-danger { color: #B42318; }

/* ── users and roles, redesign 2026-11-05 ── */
.u-tabs { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 12px; padding: 4px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 10px; }
.u-tabs button { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: none; border-radius: 7px; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--p-muted); cursor: pointer; }
.u-tabs button:hover { background: var(--p-line-soft); color: var(--p-ink); }
.u-tabs button.on { background: var(--p-nav); color: #FFF; }
.u-tab-n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--p-line-soft); color: var(--p-ink); font-size: 12px; text-align: center; }
.u-tabs button.on .u-tab-n { background: rgba(255, 255, 255, .2); color: #FFF; }
.u-person { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.u-person:hover b { color: var(--p-action); }
.u-av { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--p-nav); color: var(--p-accent); font-weight: 700; }
.u-av.ext { background: #E8EFFA; color: #1F4E8C; }
.u-av.off { background: var(--p-line-soft); color: var(--p-muted); }
.u-who { display: flex; flex-direction: column; min-width: 0; }
.u-who b { color: var(--p-ink); font-weight: 700; }
.u-who small { color: var(--p-muted); font-size: 12px; }
.u-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.u-chip { padding: 1px 9px; border-radius: 999px; background: #EEF3FA; color: var(--p-primary); font-size: 12px; font-weight: 600; white-space: nowrap; }
.u-chip.more { background: var(--p-line-soft); color: var(--p-muted); }
.u-role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 14px; }
.u-role-card { --role: var(--p-primary); display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--p-line); border-inline-start: 4px solid var(--role); border-radius: 10px; background: var(--p-surface); color: inherit; text-decoration: none; transition: box-shadow .15s, border-color .15s; }
.u-role-card:hover { border-color: var(--p-action); box-shadow: 0 2px 10px rgba(15, 42, 79, .08); }
.u-role-card.off { opacity: .65; }
.u-role-card .top { display: flex; align-items: center; gap: 8px; }
.u-role-card .top b { flex: 1; min-width: 0; color: var(--p-ink); font-size: 14.5px; overflow-wrap: anywhere; }
.u-role-card .u-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #EEF3FA; color: var(--p-primary); }
.u-role-card small { color: var(--p-muted); font-size: 12.5px; min-height: 18px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.u-role-card .foot { display: flex; align-items: center; gap: 4px; color: var(--p-muted); font-size: 12.5px; }
.a-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.a-head h2 { margin: 0; }
.a-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; align-items: start; }
.a-field i { color: #B42318; font-style: normal; }
.a-field .p-dayfield { width: 100%; }
input.a-ltr { direction: ltr; text-align: left; }
.a-secret { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--p-line); }
.a-narrow { max-width: 460px; display: grid; gap: 12px; }
.a-bad { margin: 0; color: #B42318; font-size: 13px; }
.a-tight { margin-top: 6px; align-items: center; gap: 12px; }
.a-sign { display: grid; place-items: center; height: 84px; padding: 4px; border: 1px dashed var(--p-line); border-radius: 8px; background: #FFF; }
.a-sign img { max-width: 100%; max-height: 100%; object-fit: contain; }
.a-upload { position: relative; cursor: pointer; }
.a-del { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; }
.a-matrix-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.p-menu-btn { text-decoration: none; }

/* FileViewer: a document's files inside the site */
.p-file-open { align-items: flex-start; padding: 0; border: 0; background: none; font: inherit; text-align: start; cursor: pointer; }
.p-file-open .name { max-width: 100%; }
.p-file-open:hover .name { color: var(--p-primary); text-decoration: underline; }
.fv { position: fixed; inset: 0; z-index: 1450; display: flex; flex-direction: column; background: #16263F; color: #FFFFFF; outline: 0; }
.fv-bar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 16px; background: #0B1F3A; }
.fv-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fv-pager { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; font-size: 13px; white-space: nowrap; }
.fv-actions { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.fv-actions .mud-icon-button, .fv-pager .mud-icon-button { color: #FFFFFF; }
.fv-body { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.fv-body iframe { width: 100%; height: 100%; border: 0; background: #FFFFFF; }
.fv-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fv-none { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; text-align: center; }
.fv-none p { margin: 0; }
@media (max-width: 600px) { .fv-bar { flex-wrap: wrap; padding: 6px 10px; } .fv-name { flex-basis: 100%; order: -1; } .fv-actions { margin-inline-start: auto; } }

/* ActivityTimeline: a document's log */
.at { list-style: none; margin: 0; padding: 0; }
.at-step { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.at-step:last-child { padding-bottom: 0; }
.at-step:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 15px; top: 32px; bottom: 0; width: 2px; background: var(--p-line); }
.at-mark { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #EEF1F5; color: #5B6B82; }
.at-step.approved .at-mark { background: #E6F4EC; color: #1E7B45; }
.at-step.danger .at-mark { background: #FBEAEA; color: #B3261E; }
.at-step.pending .at-mark { background: #FFF4DF; color: #A86A00; }
.at-step.warn .at-mark { background: #FFF4DF; color: #A86A00; }
.at-body { flex: 1 1 auto; min-width: 0; padding-top: 4px; }
.at-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.at-action { font-weight: 700; color: var(--p-ink); }
.at-when { display: inline-flex; gap: 8px; font-size: 12.5px; color: var(--p-muted); white-space: nowrap; }
.at-who { margin-top: 2px; font-size: 13.5px; color: var(--p-text); }
.at-note { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #F9FAFB; font-size: 13px; color: var(--p-text); white-space: pre-line; }

/* a purchase order's tables: fit the page without sideways scrolling on a computer, figures in even columns */
.p-po-lines { min-width: 700px; }
.p-po-lines th, .p-po-lines td { padding-inline: 10px; }
.p-po-lines th.center, .p-po-lines td.n { white-space: nowrap; }
.p-po-lines td.n { font-variant-numeric: tabular-nums; }
.p-po-lines td.strong { font-weight: 700; color: var(--p-ink); }
.p-po-lines .title .d + .d { margin-top: 1px; }
.p-po-sum dd { font-variant-numeric: tabular-nums; }
.p-po-sum dd small { font-size: 12px; font-weight: 600; color: var(--p-muted); }
.p-po-sum .grand dt { font-weight: 800; color: var(--p-ink); }
.p-po-sum dd { min-width: 150px; }   /* one box for every row: the figures end at the same edge */
.at-step.upcoming .at-mark { background: #FFFFFF; color: #A5AFBD; }
.at-step.upcoming .at-action { font-weight: 600; color: var(--p-muted); }
.at-step.upcoming .at-who { color: var(--p-muted); }

/* a document's shared cards */
.p-doc-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.p-file-status { flex-shrink: 0; font-size: 12.5px; }

/* SubmittalDashboard: one submittal type's dashboard, a dark head over the page */
.sd-hero { position: relative; padding: 22px 26px 24px; margin-bottom: 18px; border-radius: 16px; color: #FFFFFF; overflow: hidden;
    background: linear-gradient(115deg, #0B1F3A 0%, #0B1F3A 52%, color-mix(in srgb, var(--sd) 58%, #0B1F3A) 100%); box-shadow: 0 14px 30px -18px rgba(11, 31, 58, .75); }
.sd-hero-top { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.sd-hero-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; color: #FFFFFF; background: var(--sd); }
.sd-hero-title { flex: 1 1 280px; min-width: 0; }
.sd-hero-title .k { font-size: 12.5px; font-weight: 600; color: var(--p-accent); }
.sd-hero-title h1 { margin: 2px 0 4px; font-size: clamp(21px, 2vw, 27px); font-weight: 800; color: #FFFFFF; }
.sd-hero-title p { margin: 0; font-size: 13.5px; color: #C9D3E0; }
.sd-hero-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-select { height: 38px; max-width: 240px; padding: 0 10px; border-radius: 10px; font: inherit; font-size: 13.5px; color: #FFFFFF; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1); }
.sd-select option { color: var(--p-ink); background: #FFFFFF; }
.sd-register { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: #FFFFFF; text-decoration: none; border: 1px solid rgba(255, 255, 255, .28); }
.sd-register:hover { background: rgba(255, 255, 255, .12); }
.sd-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px 0 0; }
.sd-figures > div { min-width: 0; padding: 0 22px; border-inline-start: 1px solid rgba(255, 255, 255, .16); }
.sd-figures > div:first-child { padding-inline-start: 0; border-inline-start: 0; }
.sd-figures dt { font-size: 13px; color: #C9D3E0; }
.sd-figures dd { margin: 4px 0 2px; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.1; font-weight: 800; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.sd-figures small { display: block; font-size: 12.5px; color: #A9B7CB; }
.sd-figures .alert dd { color: #FF9B91; }
.sd-figures .good dd { color: #7EE2A8; }
.sd-loading { margin: -14px 0 14px; }
.sd-path { padding: 20px 22px 16px; margin-bottom: 16px; border-radius: 14px; border: 1px solid var(--p-line); background: #FFFFFF; }
.sd-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sd-flow li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.sd-flow li::before { content: ""; position: absolute; top: 7px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--p-line); }
.sd-flow li:last-child::before { display: none; }
.sd-flow .dot { position: relative; width: 16px; height: 16px; border-radius: 50%; margin-bottom: 8px; background: var(--step); box-shadow: 0 0 0 4px #FFFFFF; }
.sd-flow b { font-size: 26px; line-height: 1.15; font-weight: 800; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.sd-flow .l { font-size: 13.5px; font-weight: 600; color: var(--p-text); }
.sd-flow small { font-size: 12px; color: var(--p-muted); font-variant-numeric: tabular-nums; }
.sd-exits { list-style: none; margin: 16px 0 0; padding: 12px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; border-top: 1px solid var(--p-line-soft); }
.sd-exits li { padding: 4px 12px; border-radius: 16px; font-size: 13px; color: var(--p-text); background: #F3F5F8; }
.sd-exits b { margin-inline-start: 4px; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.sd-exits .warn { background: #FFF4DF; }
.sd-exits .bad { background: #FBEAEA; }
.sd-section { margin: 24px 0 12px; font-size: 18px; font-weight: 800; color: var(--p-ink); }
.sd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sd-head h2 { margin: 0; }
.sd-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.sd-row.wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.sd-row > .p-card { min-width: 0; margin: 0; }
.sd-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.sd-bars.plain li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; align-items: center; gap: 10px; font-size: 13.5px; }
.sd-bars .n { color: var(--p-text); overflow-wrap: anywhere; }
.sd-bars .b { height: 10px; border-radius: 5px; background: var(--p-line-soft); overflow: hidden; display: block; }
.sd-bars .b i { display: block; height: 100%; border-radius: 5px; }
.sd-bars b { color: var(--p-ink); font-variant-numeric: tabular-nums; }
.sd-groups, .sd-list { margin-bottom: 16px; }
.sd-row > .sd-groups, .sd-row > .sd-list { margin-bottom: 0; }
.sd-list .p-card-head { justify-content: space-between; }
@media (max-width: 1000px) { .sd-row, .sd-row.wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
    .sd-hero { padding: 18px 16px; }
    .sd-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 0; }
    .sd-figures > div { padding: 0 12px; }
    .sd-figures > div:nth-child(odd) { padding-inline-start: 0; border-inline-start: 0; }
    .sd-flow b { font-size: 21px; }
    .sd-flow .l { font-size: 12px; }
}
.sd-dec { display: flex; flex-direction: column; }
.sd-ring { position: relative; width: min(200px, 70%); margin: 4px auto 18px; }
.sd-ring svg { display: block; width: 100%; height: auto; }
.sd-ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.sd-ring .c b { font-size: 30px; font-weight: 800; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.sd-ring .c small { font-size: 13px; color: var(--p-muted); }
.sd-dec-rows { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sd-dec-rows li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 48px; align-items: center; column-gap: 10px; row-gap: 5px; font-size: 13.5px; }
.sd-dec-rows .code { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #FFFFFF; font-size: 12px; font-weight: 800; }
.sd-dec-rows .n { color: var(--p-text); min-width: 0; }
.sd-dec-rows b { color: var(--p-ink); font-variant-numeric: tabular-nums; }
.sd-dec-rows small { text-align: left; color: var(--p-muted); font-variant-numeric: tabular-nums; }
.sd-dec-rows .b { grid-column: 2 / -1; height: 6px; border-radius: 3px; background: var(--p-line-soft); overflow: hidden; }
.sd-dec-rows .b i { display: block; height: 100%; border-radius: 3px; }
.sd-dec-rows .zero .code { opacity: .4; }
.sd-dec-rows .zero .n, .sd-dec-rows .zero b { color: var(--p-muted); font-weight: 400; }
.sd-row > .p-card:has(> .sd-bars.plain) { display: flex; flex-direction: column; }
.sd-bars.plain { flex: 1 1 auto; justify-content: space-evenly; font-size: 14px; }
.sd-bars.plain .b { height: 14px; border-radius: 7px; }
.sd-bars.plain .b i { border-radius: 7px; }

/* التكلفة التنفيذية: one line of figures, a list with its own scroll and fixed header, the item's analysis under it */
.xc-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.xc-fig { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 10px; background: var(--p-surface); border: 1px solid var(--p-line); border-inline-start: 4px solid var(--c); border-radius: 10px; }
.xc-fig-i { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #FFFFFF); }
.xc-fig-t { display: flex; flex-direction: column; min-width: 0; }
.xc-fig-t > span { font-size: 12px; color: var(--p-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-fig-t b { font-size: 17px; line-height: 1.2; font-weight: 800; color: var(--c); font-variant-numeric: tabular-nums; }
.xc-fig-t small { font-size: 11.5px; color: var(--p-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-btn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border: 1px solid var(--p-line); border-radius: 8px; background: var(--p-surface); color: var(--p-ink); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s; }
.xc-btn .mud-icon-root { color: var(--p-primary); font-size: 18px; }
.xc-btn:hover:not(:disabled) { background: var(--p-primary-soft); border-color: var(--p-primary); }
.xc-btn:focus-visible, .xc-seg button:focus-visible { outline: 2px solid var(--p-primary); outline-offset: 1px; }
.xc-btn:disabled { opacity: .5; cursor: not-allowed; }
.xc-btn.on { background: var(--p-primary); border-color: var(--p-primary); color: #FFFFFF; }
.xc-btn.on .mud-icon-root { color: #FFFFFF; }
.xc-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.xc-view select { border: none; outline: none; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.xc-cols summary { list-style: none; }
.xc-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 10px; }
.xc-seg button { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 7px; border: none; border-radius: 7px; background: transparent; color: var(--c); font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.xc-seg button .mud-icon-root { font-size: 16px; }
.xc-seg button em { font-style: normal; min-width: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; text-align: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #FFFFFF); }
.xc-seg button:hover { background: color-mix(in srgb, var(--c) 9%, #FFFFFF); }
.xc-seg button.on { background: var(--c); color: #FFFFFF; }
.xc-seg button.on em { color: var(--c); background: #FFFFFF; }
.xc-notice, .xc-more { margin-bottom: 10px; }
.xc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.xc-bar .p-search { min-width: 170px; flex: 0 1 220px; }
.xc-sep { width: 1px; align-self: stretch; margin-inline: 4px; background: var(--p-line); }
.xc-push { margin-inline-start: auto; display: inline-flex; }
.xc-cols { position: relative; }
.xc-cols summary::-webkit-details-marker { display: none; }
.xc-cols-menu { position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline-start: 0; min-width: 220px; max-height: 340px; overflow: auto; padding: 8px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 10px; box-shadow: var(--p-shadow); }
.xc-cols-menu label { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.xc-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; scroll-margin-top: 72px; }
.xc-body.with-pane { grid-template-columns: 230px minmax(0, 1fr); }
.xc-main { min-width: 0; }
.xc-list, .xc-secs { height: max(320px, calc(100vh - 430px)); }
.xc-list.open { height: 300px; }
.xc-list { overflow: auto; }
.xc-secs { overflow: auto; padding: 8px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; height: calc(max(320px, calc(100vh - 430px)) + 47px); }
.xc-secs.open { height: 347px; }
.xc-secs-search { width: 100%; margin-bottom: 6px; padding: 5px 9px; border: 1px solid var(--p-line); border-radius: 8px; font: inherit; font-size: 12.5px; background: var(--p-surface); color: var(--p-ink); }
.xc-node-row { display: flex; align-items: center; min-width: 0; }
.xc-fold { flex: 0 0 18px; width: 18px; border: none; background: transparent; color: var(--p-muted); font-size: 11px; cursor: pointer; padding: 0; }
.xc-node { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; width: 100%; padding: 4px 6px; border: none; border-radius: 7px; background: transparent; color: var(--p-ink); font: inherit; font-size: 12.5px; text-align: start; cursor: pointer; }
.xc-node:hover { background: var(--p-line-soft); }
.xc-node.on { background: var(--p-primary); color: #fff; }
.xc-node.lv0 { font-weight: 700; }
.xc-node .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-node em { flex: none; font-style: normal; font-size: 11px; color: var(--p-muted); white-space: nowrap; }
.xc-node.on em { color: rgba(255, 255, 255, .8); }
.xc-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.xc-table th { position: sticky; z-index: 2; padding: 0 6px; font-weight: 700; font-size: 12px; color: var(--p-muted); background: #F6F8FB; border-bottom: 1px solid var(--p-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-table thead tr.b th { top: 0; height: 26px; text-align: center; color: var(--p-ink); border-inline-end: 1px solid var(--p-line); }
.xc-table thead tr.c th { top: 26px; height: 38px; text-align: start; white-space: normal; line-height: 1.15; }
.xc-table th.band-res, .xc-table th.band-unit, .xc-table th.band-total { background: #E6F3EE; }
.xc-table tr.b th.band-res, .xc-table tr.b th.band-unit, .xc-table tr.b th.band-total { background: #CFE8DF; }
.xc-table th.band-profit { background: #F1EDFA; }
.xc-table tr.b th.band-profit { background: #E2DCF3; }
.xc-table td { height: 46px; padding: 2px 6px; overflow: hidden; border-bottom: 1px solid var(--p-line-soft); vertical-align: middle; line-height: 1.3; }
.xc-table .stick { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--p-surface); }
.xc-table th.stick { z-index: 3; background: #F6F8FB; }
.xc-table tbody tr { cursor: pointer; }
.xc-table tbody tr:hover td { background: #FFFBE5; }
.xc-table tbody tr.on td { background: #FFF4C2; }
.xc-table tbody tr.on td:first-child { box-shadow: inset -3px 0 0 var(--p-accent); }
.xc-table tbody tr.none td { color: var(--p-muted); }
.xc-table th.num, .xc-table td.num { direction: ltr; unicode-bidi: isolate; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.xc-table td.num { font-weight: 600; font-size: 12.5px; }
.xc-table td.nowrap { white-space: nowrap; text-overflow: ellipsis; }
.xc-table tr.xc-sec td { background: #EEF3FA; color: var(--p-primary); font-weight: 700; }
.xc-table tr.xc-sec.lv0 td { background: var(--p-primary-soft); }
.xc-table tr.xc-sec:hover td { background: #E3ECF8; }
.xc-head { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.xc-head i { font-style: normal; font-size: 11px; color: var(--p-muted); }
.xc-head-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.xc-head small { flex: none; font-weight: 400; font-size: 11px; color: var(--p-muted); }
.xc-table tr.xc-line td { background: #FFFCF2; font-size: 12.5px; color: var(--p-muted); }
.xc-table tr.xc-line td.tint-a { background: #F1F9F5; }
.xc-table tr.xc-line td.num { font-weight: 400; color: var(--p-ink); }
.xc-type { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--p-line-soft); font-size: 11px; }
.xc-detail { margin-top: 10px; min-height: calc(100vh - 372px); }
.xc-btn.danger .mud-icon-root, .xc-btn.danger { color: #C23434; }
.xc-btn.danger:hover:not(:disabled) { background: #FDECEC; border-color: #C23434; }
.xc-lump .p-card-head h2 .mud-icon-root { color: var(--p-accent); }
.xc-tab { height: 28px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 7px; background: transparent; color: #FFFFFF; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.xc-tab:hover { background: rgba(255, 255, 255, .1); }
.xc-tab.on { background: var(--p-accent); border-color: var(--p-accent); color: var(--p-accent-ink); }
.xc-lump-note { margin: 12px 16px; }
.xc-lump-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--p-line-soft); }
.xc-lump-form > label:not(.p-search) { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--p-muted); }
.xc-lump-form > label input { min-width: 150px; }
.xc-lump-form > label.grow input { min-width: 220px; }
.xc-list.xc-lump-list { height: max(320px, calc(100vh - 560px)); }
.xc-table thead tr.flat th { top: 0; height: 42px; text-align: start; white-space: normal; line-height: 1.15; }
.xc-table thead tr.flat th.num { text-align: right; }
.xc-table tbody tr.static { cursor: default; }
.xc-table td.center { text-align: center; }
.xc-share { width: 100%; min-width: 0; text-align: right; }
.xc-lump-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--p-line-soft); }
.xc-rep { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; padding: 14px 16px; }
.xc-rep-list { display: grid; gap: 6px; align-content: start; }
.xc-rep-item { --c: var(--p-primary); display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--p-line); border-radius: 10px; background: var(--p-surface); color: var(--p-ink); font: inherit; text-align: start; cursor: pointer; }
.xc-rep-item:hover { border-color: var(--p-primary); }
.xc-rep-item.on { border-color: var(--p-primary); background: var(--p-primary-soft); box-shadow: inset 0 0 0 1px var(--p-primary); }
.xc-rep-item:focus-visible { outline: 2px solid var(--p-primary); outline-offset: 1px; }
.xc-rep-item .t { display: flex; flex-direction: column; min-width: 0; }
.xc-rep-item b { font-size: 13.5px; }
.xc-rep-item small { font-size: 12px; color: var(--p-muted); line-height: 1.35; }
.xc-rep-opts h3 { margin: 10px 0 6px; font-size: 13.5px; }
.xc-rep-opts h3:first-child { margin-top: 0; }
.xc-opt { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.xc-opt.off { opacity: .5; cursor: default; }
.xc-th { width: 74px; }
.xc-rep-secs { max-height: 170px; overflow: auto; margin: 4px 0 6px; padding: 4px 8px; border: 1px solid var(--p-line); border-radius: 8px; }
/* the workspace: the full width, three views */
.p-content:has(.xw) { max-width: none; }
.p-content:has(.xw) { padding-top: 12px; }
/* the title stays for screen readers; the chosen tab already names the screen, and the rows need the height */
.p-content:has(.xw) .p-header { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.p-tabbar { display: contents; }
.p-content:has(.xw) .p-tabbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.p-content:has(.xw) .p-tabbar .p-tabs { flex: 1 1 auto; margin: 0; padding: 3px; }
.p-content:has(.xw) .p-tabbar .p-tabs a { padding: 6px 14px; }
.p-content:has(.xw) .p-tabbar .p-toolbar { margin: 0; order: 2; }
.xw-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--p-line); }
.xw-views { display: inline-flex; gap: 3px; padding: 3px; background: var(--p-line-soft); border-radius: 10px; }
.xw-views button { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 14px; border: none; border-radius: 8px; background: transparent; color: var(--p-muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.xw-views button:hover { color: var(--p-ink); }
.xw-views button.on { background: var(--p-surface); color: var(--p-primary); box-shadow: 0 1px 3px rgba(15, 42, 79, .18); }
.xw-views button:focus-visible { outline: 2px solid var(--p-primary); }
.xw-fold { display: grid; gap: 2px; min-width: 150px; }
.xw-fold button { padding: 6px 8px; border: none; border-radius: 6px; background: transparent; color: var(--p-ink); font: inherit; font-size: 13px; text-align: start; cursor: pointer; }
.xw-fold button:hover { background: var(--p-primary-soft); }
.xc-list:focus-visible { outline: 2px solid var(--p-primary); outline-offset: -2px; }
.xc-table tfoot td { position: sticky; bottom: 0; z-index: 2; height: 38px; padding: 0 6px; background: #E8EEF7; color: var(--p-ink); font-weight: 800; border-top: 2px solid var(--p-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-table tbody tr.st-loss td:first-child { box-shadow: inset -3px 0 0 #C23434; }
.xc-table tbody tr.st-low td:first-child { box-shadow: inset -3px 0 0 #E8962E; }
.xc-table tbody tr.st-ok td:first-child { box-shadow: inset -3px 0 0 #1F9D55; }
.xw-bar { display: flex; width: 100%; height: 8px; border-radius: 999px; overflow: hidden; background: var(--p-line-soft); }
.xw-bar i { display: block; height: 100%; }
.xw-bar.big { height: 12px; }
.xw-m { display: inline-block; min-width: 46px; padding: 1px 6px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; }
.xw-m.ok { background: #E7F6EC; color: #1E7B34; }
.xw-m.low { background: #FDF1DD; color: #9A6200; }
.xw-m.bad { background: #FDE8E8; color: #C23434; }
.xw-abc { display: inline-block; width: 20px; line-height: 20px; border-radius: 6px; text-align: center; font-size: 12px; font-weight: 800; }
.xw-abc.a { background: var(--p-primary); color: #FFFFFF; }
.xw-abc.b { background: #C9D6EA; color: var(--p-primary); }
.xw-abc.c { background: var(--p-line-soft); color: var(--p-muted); }
.xw-type { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #FFFFFF); }
.xc-list.xw-res { height: max(320px, calc(100vh - 340px)); }
.xw-uses { max-height: 300px; overflow: auto; }
.xw-grid { display: grid; gap: 10px; }
.xw-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.xw-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xw-h { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 14px; }
.xw-h .mud-icon-root { color: var(--p-primary); }
.xw-hbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 110px; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.xw-hbar b { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
.xw-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--p-line-soft); font-size: 13px; color: var(--p-muted); }
.xw-result b { font-size: 20px; color: #1E7B34; font-variant-numeric: tabular-nums; }
.xw-result.neg b { color: #C23434; }
.xw-cov { margin-bottom: 10px; font-size: 13px; }
.xw-cov > div { display: flex; justify-content: space-between; margin-bottom: 3px; }
.xw-cov small { color: var(--p-muted); }
.xw-cov-cell { min-width: 130px; }
.xw-cov-cell small { color: var(--p-muted); font-size: 11.5px; }
.xw-alerts { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.xw-alerts li { padding: 3px 0; color: var(--p-muted); }
.xw-alerts li b { color: var(--p-ink); }
.xw-alerts li.warn b { color: #9A6200; }
.xw-alerts li.bad b { color: #C23434; }
/* an item's cost build-up: what it costs against what it sells for, kept above its lines */
.ra-kpi { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--p-line); background: #F8FAFD; }
.ra-kpi.preview { background: #FFFBE5; }
.ra-kpi > div { display: flex; flex-direction: column; min-width: 120px; padding: 8px 14px; border-inline-end: 1px solid var(--p-line-soft); }
.ra-kpi span { font-size: 12px; color: var(--p-muted); }
.ra-kpi b { font-size: 16px; color: var(--p-ink); font-variant-numeric: tabular-nums; }
.ra-kpi small { font-size: 11px; color: var(--p-muted); }
.ra-kpi .neg b { color: #C23434; }
.ra-kpi > .mix { flex: 1 1 220px; gap: 3px; border-inline-end: none; }
.ra-table tbody tr.static td:first-child { box-shadow: inset -3px 0 0 var(--c, transparent); }
.ra-foot:has(.ra-save:only-child) { padding-block: 8px; }
.xc-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1250px) { .xc-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .xc-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .xw-grid.three, .xw-grid.two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .xc-rep { grid-template-columns: minmax(0, 1fr); } .xc-body.with-pane { grid-template-columns: minmax(0, 1fr); } .xc-secs, .xc-secs.open { height: 200px; } }

/* subcontract distribution: two panes + the focused line's shares (SubcontractDistribution.razor) */
.p-dist-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 18px; }
.p-dist-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 0 18px 12px; }
.p-dist-pane { min-width: 0; border: 1px solid var(--p-line); border-radius: 10px; overflow: hidden; }
.p-dist-pane-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.p-dist-pane-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--p-primary); }
.p-dist-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.p-dist-filter input.p-cell-input { width: 210px; }
.p-dist-scroll { max-height: 56vh; overflow: auto; }
.p-dist-scroll thead th { position: sticky; top: 0; z-index: 1; }
.p-dist-scroll tr[draggable="true"] { cursor: grab; }
.p-dist-scroll table { min-width: 640px; }
.p-dist-scroll td.p-wrap { min-width: 220px; }
.p-dist-scroll input.p-cell-input { width: 64px; min-width: 0; padding-inline: 4px; }
.p-dist-section td { white-space: normal; }
.p-dist-section { cursor: pointer; font-weight: 700; }
.p-dist-section td { background: var(--p-primary-soft); }
.p-dist-focus td { background: rgba(201, 162, 78, .22); }
.p-dist-mine td { background: rgba(201, 162, 78, .14); }
.p-drop-over td { background: rgba(37, 99, 235, .18) !important; box-shadow: inset 0 1px 0 #2563eb, inset 0 -1px 0 #2563eb; }
.p-dist-shares { padding: 0 18px 14px; }
.p-dist-shares input.p-cell-input { width: 90px; }
@media (max-width: 900px) { .p-dist-panes { grid-template-columns: minmax(0, 1fr); } }

/* a new BOQ (BoqImport.razor) */
.p-boq-new { padding: 16px 18px; }
.p-boq-new .p-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-weight: 600; color: var(--p-primary); }
.p-boq-new .p-field.wide { grid-column: 1 / -1; }
.p-boq-new .p-input, .p-boq-new .p-select { width: 100%; }
.p-boq-new .p-input { padding: 9px 12px; border: 1px solid var(--p-line); border-radius: 8px; background: var(--p-surface); font: inherit; font-weight: 400; }
.p-boq-new .p-input:focus { outline: 2px solid var(--p-primary); outline-offset: 0; border-color: transparent; }
.p-boq-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; }
.p-boq-file .d-ai-run { width: auto; min-width: 220px; }
.p-boq-preview { max-height: 56vh; overflow: auto; }
.p-boq-columns { padding: 0 18px 14px; }
.p-boq-columns summary { cursor: pointer; font-weight: 600; color: var(--p-primary); }
.p-boq-columns-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.p-boq-columns .p-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.p-boq-columns .p-input { width: 100%; padding: 7px 10px; border: 1px solid var(--p-line); border-radius: 8px; background: var(--p-surface); font: inherit; font-weight: 400; }

/* the BOQ items editor (BoqItemsEditor.razor) */
.p-boq-edit-open { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.p-boq-edit-bar { position: sticky; top: 58px; z-index: 3; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 10px; }
.p-boq-editing { min-width: 1320px; table-layout: fixed; }
.p-boq-editing th:nth-child(1) { width: 58px; }
.p-boq-editing th:nth-child(2) { width: 120px; }
.p-boq-editing th:nth-child(4) { width: 130px; }
.p-boq-editing th:nth-child(5) { width: 80px; }
.p-boq-editing th:nth-child(6), .p-boq-editing th:nth-child(7) { width: 105px; }
.p-boq-editing th:nth-child(8) { width: 115px; }
.p-boq-editing th:nth-child(9), .p-boq-editing th:nth-child(10) { width: 70px; }
.p-boq-editing th:nth-child(11) { width: 124px; }
.p-boq-editing .p-cell-input { width: 100%; min-width: 0; }
.p-boq-text { display: block; resize: vertical; line-height: 1.5; white-space: pre-wrap; field-sizing: content; }
.p-boq-edit-row td { vertical-align: top; padding-block: 5px; }
.p-boq-edit-row.bad td { background: #FDECEC; }
.p-boq-row-tools { white-space: nowrap; }
.p-boq-tool { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--p-primary); cursor: pointer; }
.p-boq-tool:hover:not(:disabled) { background: var(--p-primary-soft); }
.p-boq-tool.danger { color: #B42318; }
.p-boq-tool:disabled { opacity: .3; cursor: not-allowed; }
.p-boq-edit-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.p-boq-edit-sep { width: 1px; height: 20px; background: var(--p-line); margin-inline: 4px; }
.p-boq-pick { white-space: nowrap; padding-inline: 6px !important; vertical-align: top; }
.p-boq-grip { display: inline-flex; vertical-align: middle; color: var(--p-muted); cursor: grab; }
.p-boq-section-edit td { vertical-align: middle; cursor: default; }
.p-boq-section-no { display: flex; align-items: center; gap: 2px; }
.p-boq-section-name { font-weight: 700; }
.p-boq-editing tr.picked > td { background: rgba(201, 162, 78, .20); }
.p-boq-section-edit.bad > td { background: #FDECEC; }
.p-boq-editing tr.p-drop-upper > td { box-shadow: inset 0 2px 0 #2563eb !important; background: rgba(37, 99, 235, .06) !important; }
.p-boq-editing tr.p-drop-lower > td { box-shadow: inset 0 -2px 0 #2563eb !important; background: rgba(37, 99, 235, .06) !important; }

/* the command ribbon of a working screen (ActionRibbon, RibbonGroup, RibbonButton): BOQ and execution cost */
.p-ribbon { display: flex; flex-wrap: wrap; align-items: stretch; row-gap: 4px; margin-bottom: 8px; padding: 3px 2px; background: var(--p-surface); border: 1px solid var(--p-line); border-top: 2px solid var(--p-accent); border-radius: 10px; }
.p-ribbon-group { display: flex; flex-direction: column; justify-content: space-between; gap: 1px; padding-inline: 3px; border-inline-end: 1px solid var(--p-line); }
.p-ribbon-group:last-child { border-inline-end: none; }
.p-ribbon-cmds { display: flex; align-items: flex-start; gap: 1px; }
.p-ribbon-title { font-size: 10.5px; line-height: 13px; font-weight: 600; color: var(--p-muted); text-align: center; white-space: nowrap; }
.p-ribbon-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; min-width: 46px; max-width: 104px; height: 42px; padding: 3px 4px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--p-ink); font: inherit; font-size: 11px; line-height: 13px; font-weight: 600; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s; }
.p-ribbon-btn .mud-icon-root { flex: none; font-size: 19px; color: var(--p-primary); }
.p-ribbon-btn span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.p-ribbon-btn:hover:not(:disabled) { background: var(--p-accent-soft); border-color: var(--p-accent); }
.p-ribbon-btn:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 0; }
.p-ribbon-btn:disabled { opacity: .42; cursor: not-allowed; }
.p-ribbon-btn.on { background: var(--p-primary); color: #FFFFFF; }
.p-ribbon-btn.on .mud-icon-root { color: var(--p-accent); }
.p-ribbon-btn.success .mud-icon-root { color: #1F9D55; }
.p-ribbon-btn.danger .mud-icon-root { color: #C23434; }
.p-ribbon-note { margin-bottom: 8px; }
.p-boq-review { margin-bottom: 8px; padding: 0 0 8px; }
.p-boq-review ul { margin: 0; padding: 8px 18px 0; list-style: none; max-height: 220px; overflow: auto; }
.p-boq-review li { display: flex; gap: 10px; padding: 3px 0; font-size: 13px; }
.p-boq-review li bdi { font-weight: 700; }
.p-boq-review li.bad { color: #C23434; }
.p-boq-review > .p-muted { padding: 4px 18px 0; }
/* the BOQ page's figures in less height */
.p-boq-summary { gap: 8px; padding-block: 10px; margin-bottom: 10px; }
.p-boq-summary .p-sums { gap: 6px; }
.p-boq-summary .p-sum { flex: 1 1 120px; min-width: 0; padding: 4px 10px; gap: 0; }
.p-boq-summary .p-sum .l { font-size: 11.5px; }
.p-boq-summary .p-sum .v { font-size: 15px; }
.p-boq-summary > .p-muted { font-size: 12px; }
/* the execution cost's list gets the height of its heading */
.xw .xc-main > .p-card-head { padding-block: 5px; }
.p-boq-edit-bar .p-ribbon { margin-bottom: 0; border: none; border-top: 2px solid var(--p-accent); border-radius: 8px 8px 0 0; }
@media (max-width: 700px) { .p-ribbon { flex-wrap: nowrap; overflow-x: auto; } .p-ribbon-group { flex: none; } }

/* NAVORG: the register template - views, saved views, columns, the rows picked, the deadline (RegisterViews, SubmittalRegister, RfiRegister) */
.rv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.rv-grow { flex: 1; }
.rv-chip { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border: 1px solid var(--p-line); border-radius: 16px; background: var(--p-surface);
    color: var(--p-muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rv-chip:hover { border-color: var(--p-primary); color: var(--p-ink); }
.rv-chip .n { font-size: 12px; padding: 0 6px; border-radius: 9px; background: var(--p-line-soft); color: var(--p-ink); }
.rv-chip.on { background: var(--p-primary); border-color: var(--p-primary); color: #FFFFFF; }
.rv-chip.on .n { background: rgba(255, 255, 255, .22); color: #FFFFFF; }
.rv-chip.red:not(.on) .n { background: #FDECEC; color: #B42318; }
.rv-chip.blue:not(.on) .n { background: #E7EFFB; color: #1F5FB8; }
.rv-chip.add { border-style: dashed; }
.rv-chip.saved { padding: 0 4px 0 0; gap: 0; }
.rv-saved, .rv-x { border: none; background: none; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 30px; }
.rv-x { padding: 0 8px; font-size: 16px; color: var(--p-muted); }
.rv-x:hover { color: #B42318; }
.rv-name { display: inline-flex; align-items: center; gap: 4px; }
.rv-name input { height: 32px; padding: 0 10px; border: 1px solid var(--p-primary); border-radius: 16px; font: inherit; font-size: 13.5px; outline: none; }
.rv-name button { height: 30px; padding: 0 10px; border: 1px solid var(--p-line); border-radius: 15px; background: var(--p-surface); font: inherit; font-size: 13px; cursor: pointer; }
.rv-cols { position: relative; }
.rv-cols-pop { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 1301; min-width: 180px; padding: 8px; background: var(--p-surface);
    border: 1px solid var(--p-line); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 42, 79, .18); }
.rv-cols-pop label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: 14px; cursor: pointer; border-radius: 6px; }
.rv-cols-pop label:hover { background: var(--p-line-soft); }
.rv-bulk { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--p-primary-soft); border-bottom: 1px solid var(--p-line); }
.rv-bulk .p-report-actions { margin: 0; }
.r-table .rv-check { width: 36px; text-align: center; }
.r-table tr.picked td { background: #F3F7FD; }
.rv-due { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 9px; white-space: nowrap; }
.rv-due.alert { background: #FDECEC; color: #B42318; }
.rv-due.warn { background: #FFF4E0; color: #9A5B00; }
.rv-due.ok { background: #E8F5EC; color: #1E7A43; }
.rv-due.muted { color: var(--p-muted); font-weight: 500; }
/* NAVORG: the document template - «لدى · منذ · المهلة» in the head, the fixed tabs (DocHeader, DocTabs) */
.d-head-clock { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 13.5px; color: var(--p-muted); }
.d-head-clock b { color: var(--p-ink); }
.d-head-clock .sep { color: var(--p-line); }
.d-tabs { position: sticky; top: 64px; z-index: 5; display: flex; gap: 4px; overflow-x: auto; margin: 0 0 16px; padding: 0 6px;
    background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 42, 79, .04); }
.d-tab { position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 16px; border: none; background: none;
    color: var(--p-muted); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: color .15s; }
.d-tab .mud-icon-root { font-size: 19px; opacity: .75; }
.d-tab::after { content: ""; position: absolute; inset-inline: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; transition: background .15s; }
.d-tab:hover { color: var(--p-ink); }
.d-tab:hover::after { background: var(--p-line); }
.d-tab.on { color: var(--p-primary); font-weight: 700; }
.d-tab.on .mud-icon-root { opacity: 1; color: var(--p-accent); }
.d-tab.on::after { background: var(--p-primary); }
.d-tab:focus-visible { outline: 2px solid var(--p-accent); outline-offset: -4px; border-radius: 8px; }
.d-tab .n { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--p-line-soft); color: var(--p-muted); font-size: 12px; font-weight: 700; }
.d-tab.on .n { background: var(--p-primary); color: #FFFFFF; }
.d-pane[hidden] { display: none !important; }
.d-pane > * + * { margin-top: 14px; }
/* NAVORG: the desktop registers' filters and tree on the web (RegisterFilterBar, SubmittalRegister, RfiRegister) */
.rf { margin: 0 0 12px; padding: 10px 12px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; }
.rf-closed .rf-grid, .rf-closed .rf-cols { display: none; }
.rf-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; }
.rf-col { display: grid; grid-template-rows: auto auto; gap: 10px; padding-inline-start: 14px; border-inline-start: 1px solid var(--p-line); min-width: 0; }
.rf-col:first-child { padding-inline-start: 0; border-inline-start: none; }
.rf-empty { visibility: hidden; }
.rf-closed .rf { padding: 6px 10px; }
.rf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; }
.rf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12.5px; color: var(--p-muted); font-weight: 600; }
.rf-field .p-select { width: 100%; }
.rf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.rf-closed .rf-chips { margin-top: 0; }
.rf-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid #C9DAF3; border-radius: 14px; background: #EEF4FC;
    color: #1F5FB8; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.rf-chip span { font-size: 15px; line-height: 1; }
.rf-chip:hover { border-color: #1F5FB8; }
.rf-clear { border: none; background: none; color: var(--p-muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.rf-seg { display: inline-flex; border: 1px solid var(--p-line); border-radius: 16px; overflow: hidden; background: var(--p-surface); }
.rf-seg button { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border: none; background: none; color: var(--p-muted);
    font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.rf-seg button.on { background: var(--p-primary); color: #FFFFFF; }
.r-table tr.rt-group td { padding: 0; cursor: pointer; border-bottom: 1px solid var(--p-line); }
.r-table tr.rt-group.l0 td { background: #EEF2F7; }
.r-table tr.rt-group.l1 td { background: #F5F7FA; }
.r-table tr.rt-group.l2 td { background: #FAFBFC; }
.r-table tr.rt-group:hover td { background: #E7EEF8; }
.rt-head { display: flex; align-items: center; gap: 8px; padding-block: 8px; padding-inline-end: 12px; color: var(--p-ink); }
.rt-head b { font-weight: 700; }
.rt-head .n { font-size: 12px; padding: 0 8px; border-radius: 9px; background: rgba(15, 42, 79, .08); color: var(--p-ink); font-weight: 700; }
.rt-head .n.late { background: #FDECEC; color: #B42318; }
.r-table tr.rt-group.l0 .rt-head { font-size: 14.5px; }
/* NAVORG: the register toolbar - one row of 34px controls, search and narrowing first, actions at the end (SubmittalRegister) */
.rv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; padding: 8px 10px; background: var(--p-surface);
    border: 1px solid var(--p-line); border-radius: 12px; }
.rv-bar .rv-search { flex: 1 1 200px; max-width: 320px; height: 34px; margin: 0; }
.rv-bar .rv-ctl { height: 34px; min-width: 140px; max-width: 200px; }
.rv-bar .rf-seg button { height: 32px; }
.rv-bar .p-report-actions { margin: 0; }
.rv-bar .mud-button-root { height: 34px; }
.rv-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--p-line); border-radius: 9px;
    background: var(--p-surface); color: var(--p-ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rv-btn:hover { border-color: var(--p-primary); }
.rv-btn.on { background: var(--p-primary-soft); border-color: var(--p-primary); color: var(--p-primary); }
.rv-btn .n { font-size: 12px; padding: 0 7px; border-radius: 9px; background: var(--p-primary); color: #FFFFFF; }
@media (max-width: 900px) { .rv-bar .rv-search { max-width: none; flex-basis: 100%; } .rv-bar .rv-grow { display: none; } }
/* NAVORG: the status filters as cards (StatusFilters) - an accent line, a tinted icon, the count large, the share of the whole */
.sf { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; margin-bottom: 12px; }
.sf-card { --t: #1F6FD1; --tb: #EAF2FD; position: relative; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 14px 12px; overflow: hidden;
    border: 1px solid var(--p-line); border-radius: 12px; background: var(--p-surface); font: inherit; text-align: start; cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 42, 79, .05); transition: border-color .15s, box-shadow .15s, transform .15s; }
.sf-card::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--t); }
.sf-card:hover { border-color: var(--t); box-shadow: 0 4px 12px rgba(15, 42, 79, .10); transform: translateY(-1px); }
.sf-card:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }
.sf-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--tb); color: var(--t); }
.sf-icon .mud-icon-root { font-size: 20px; }
.sf-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sf-text b { font-size: 21px; font-weight: 800; color: var(--p-ink); }
.sf-text span { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--p-muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-bar { position: absolute; inset-inline: 14px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--p-line-soft); overflow: hidden; }
.sf-bar i { display: block; height: 100%; background: var(--t); opacity: .7; }
.sf-card.on { border-color: var(--t); background: var(--tb); box-shadow: 0 0 0 1px var(--t) inset; }
.sf-card.on .sf-icon { background: var(--t); color: #FFFFFF; }
.sf-card.on .sf-text span { color: var(--p-ink); }
.sf-card.zero { opacity: .62; }
.sf-card.zero:hover, .sf-card.zero.on { opacity: 1; }
.sf-card.tone-navy { --t: #0F2A4F; --tb: #E7EDF5; }
.sf-card.tone-blue { --t: #1F6FD1; --tb: #EAF2FD; }
.sf-card.tone-amber { --t: #B7791F; --tb: #FDF4E3; }
.sf-card.tone-green { --t: #1F9D55; --tb: #E8F6EE; }
.sf-card.tone-orange { --t: #C2410C; --tb: #FDEEE6; }
.sf-card.tone-red { --t: #C62828; --tb: #FDECEC; }
.sf-card.tone-gray { --t: #64748B; --tb: #F1F4F8; }
@media (max-width: 700px) { .sf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* NAVORG: the technical dashboards brought to the desktop's (SubmittalDashboard) - a clickable path with averages and the late, the
   distribution doughnut with its criterion, my tasks, «قيد الإجراء», the recent, and the alerts beside */
.sd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.sd-main { min-width: 0; }
.sd-aside { position: sticky; top: 80px; }
@media (max-width: 1200px) { .sd-layout { grid-template-columns: minmax(0, 1fr); } .sd-aside { position: static; } }
.sd-step { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 0 4px 6px; border-radius: 12px; color: inherit; text-decoration: none; }
.sd-step:hover { background: #F5F8FC; }
.sd-step:hover .l { color: var(--p-primary); text-decoration: underline; }
.sd-step small.late { color: #B42318; font-weight: 700; }
.sd-exits a { color: inherit; text-decoration: none; }
.sd-exits a:hover { text-decoration: underline; }
.sd-head .sd-crit { margin-inline-start: auto; }
.sd-head .sd-crit button { height: 28px; font-size: 12.5px; }
.sd-donut { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; align-items: center; }
.sd-donut .sd-ring { width: 160px; margin: 0; }
.sd-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.sd-legend a, .sd-legend .row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 44px; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px;
    color: var(--p-ink); text-decoration: none; font-size: 13.5px; }
.sd-legend a:hover { background: #F3F6FA; }
.sd-legend i { width: 10px; height: 10px; border-radius: 3px; }
.sd-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-legend small { color: var(--p-muted); text-align: end; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .sd-donut { grid-template-columns: minmax(0, 1fr); } .sd-donut .sd-ring { margin: 0 auto; } }
.sd-progress { margin-bottom: 16px; }
.sd-progress .p-card-head { flex-wrap: wrap; gap: 8px; }
.sd-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.sd-progress .p-grid-edit-wrap { max-height: 420px; overflow-y: auto; }
.sd-alerts { margin: 0; }
.sd-alert-sum { display: flex; gap: 8px; padding: 0 14px 10px; }
.sd-alert-sum span { flex: 1; padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.sd-alert-sum b { display: block; font-size: 20px; font-weight: 800; }
.sd-alert-sum .crit { background: #FDECEC; color: #B42318; }
.sd-alert-sum .warn { background: #FFF4E0; color: #9A5B00; }
.sd-alert-list { list-style: none; margin: 0; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 260px); overflow-y: auto; }
.sd-alert-list a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; border-inline-start: 4px solid; text-decoration: none; color: var(--p-ink); font-size: 13px; }
.sd-alert-list .crit a { background: #FEF4F4; border-color: #C62828; }
.sd-alert-list .warn a { background: #FFF9EE; border-color: #E8962E; }
.sd-alert-list a:hover { filter: brightness(.97); }
.sd-alert-list small { color: var(--p-muted); }

/* EXECTBL: one look for the site's tables (the user asked to extend the platform's to every table) - smaller type, navy group
   titles, gold totals, one red for late and negative figures. The alternate-row shading stays on the platform only: other tables
   colour their own rows (cost control's key rows, the cash flow's past months). */
.p-table th { font-size: 12px; color: #4A5A70; }
.p-table td { font-size: 13.5px; }
.p-table td.title .t { font-size: 14px; }
.p-table td.title .d { font-size: 11.5px; }
.p-table td .p-chip { font-size: 12px; }
.p-table .p-progress b { font-size: 12px; }
.p-table thead tr.groups th, .r-table thead tr.groups th { background: #16325C; color: #FFFFFF; font-size: 12.5px; font-weight: 700; border-inline-start-color: rgba(255,255,255,.18); }
.p-table tfoot td, .r-table tfoot td { background: #FBF3DF; color: var(--p-ink); font-size: 13.5px; font-weight: 800; border-top: 2px solid var(--p-accent); }
.p-table .p-late, .r-table .p-late { color: #C23434; }
.p-exec .p-table tbody tr.static:nth-child(even) td { background: #FAFBFD; }
.p-exec .p-table tbody tr.static:hover td { background: #FFFBE5; }

/* The user's choice (2026-11-11): every page's tab bar (.p-tabs, 23 pages and the section strip) looks like the document tabs
   (.d-tabs, DocTabs.razor) - an underlined tab bar instead of the navy pill: muted labels, the open tab in the primary colour with a
   bar under it, an icon and a count when a page gives them. Placed last so it wins over the older .p-tabs rules. */
.p-tabs { gap: 4px; padding: 0 6px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 42, 79, .04); }
.p-tabs a { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 10px; border-radius: 0; background: none;
    color: var(--p-muted); font-size: 14px; font-weight: 600; transition: color .15s; }
.p-tabs a .mud-icon-root { font-size: 19px; opacity: .75; }
.p-tabs a::after { content: ""; position: absolute; inset-inline: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; transition: background .15s; }
.p-tabs a:hover { background: none; color: var(--p-ink); }
.p-tabs a:hover::after { background: var(--p-line); }
.p-tabs a.on { background: none; color: var(--p-primary); font-weight: 700; box-shadow: none; }
.p-tabs a.on .mud-icon-root { opacity: 1; color: var(--p-accent); }
.p-tabs a.on::after { background: var(--p-primary); }
.p-tabs a:focus-visible { outline: 2px solid var(--p-accent); outline-offset: -4px; border-radius: 8px; }
.p-content:has(.xw) .p-tabbar .p-tabs a { height: 40px; padding: 0 14px; }
/* no scrolling in the tab bar, either way: the tabs wrap onto a second row when they do not fit */
.p-tabs { flex-wrap: wrap; overflow: visible; row-gap: 0; }
.p-tabs a { flex-shrink: 0; }
/* six figure cards in one row on a wide screen (they wrapped five and one) */
.p-kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1300px) { .p-kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .p-kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* TBLHEAD (user, 2026-11-11: the two-row heads - navy group titles over light column titles, the single columns navy too - looked
   unfinished): one calm head for both rows. A light slate band, dark labels; each group's title centred over its columns with a navy
   rule under it (the columns it covers); the single columns' titles at the foot of both rows; a navy line closes the head. */
.p-table thead tr.groups th, .r-table thead tr.groups th,
.p-table thead tr.groups + tr th, .r-table thead tr.groups + tr th { background: #EEF2F7; color: #1C2B40; border-inline-start-color: #D5DDE8; }
.p-table thead tr.groups th, .r-table thead tr.groups th { font-size: 12.5px; font-weight: 800; letter-spacing: .1px; padding-block: 9px 6px; border-bottom: 0; }
.p-table thead tr.groups th[colspan], .r-table thead tr.groups th[colspan] { text-align: center; color: #16325C; box-shadow: inset 0 -2px 0 #16325C; background-clip: padding-box; }
.p-table thead tr.groups th[colspan] + th[colspan], .r-table thead tr.groups th[colspan] + th[colspan] { border-inline-start: 1px solid #D5DDE8; }
.p-table thead tr.groups th[rowspan], .r-table thead tr.groups th[rowspan] { text-align: start; vertical-align: bottom; color: #1C2B40; font-size: 12px; font-weight: 700; padding-bottom: 9px; border-bottom: 2px solid #16325C; }
.p-table thead tr.groups + tr th, .r-table thead tr.groups + tr th { font-size: 12px; font-weight: 700; color: #3E4D63; padding-block: 8px 9px; border-bottom: 2px solid #16325C; vertical-align: bottom; }
.p-table thead tr.groups th.g-start, .r-table thead tr.groups th.g-start,
.p-table thead tr.groups + tr th.g-start, .r-table thead tr.groups + tr th.g-start { border-inline-start: 1px solid #D5DDE8; }
.r-table thead tr.groups + tr th { top: 33px; }
/* five figure cards in one row (the budget sheet and the cost ledger, once dark heroes - the user wants one look: page head + cards) */
.p-kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1300px) { .p-kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .p-kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* TRACEPICK: cost control's «تتبع الأرقام» picker in the tab bars' frame and look (user 2026-11-11): a kind's title on top, its figures
   under it as tabs - muted with an icon, the chosen one in the primary colour with the bar under it; a thin line between kinds. */
.cc-trace-pick { display: flex; flex-wrap: wrap; align-items: stretch; margin-bottom: 14px; padding: 0 6px; background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 42, 79, .04); }
.cc-trace-pick .grp { display: flex; flex-direction: column; padding: 8px 6px 0; }
.cc-trace-pick .grp + .grp { border-inline-start: 1px solid var(--p-line-soft); }
.cc-trace-pick .head { padding: 0 10px; color: var(--p-muted); font-size: 11.5px; font-weight: 700; }
.cc-trace-pick .items { display: flex; flex-wrap: wrap; }
.cc-trace-pick a { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; color: var(--p-muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: color .15s; }
.cc-trace-pick a .mud-icon-root { font-size: 19px; opacity: .75; }
.cc-trace-pick a::after { content: ""; position: absolute; inset-inline: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; transition: background .15s; }
.cc-trace-pick a:hover { color: var(--p-ink); }
.cc-trace-pick a:hover::after { background: var(--p-line); }
.cc-trace-pick a.on { color: var(--p-primary); font-weight: 700; }
.cc-trace-pick a.on .mud-icon-root { opacity: 1; color: var(--p-accent); }
.cc-trace-pick a.on::after { background: var(--p-primary); }
.cc-trace-pick a:focus-visible { outline: 2px solid var(--p-accent); outline-offset: -4px; border-radius: 8px; }
/* TRACEPICK (user 2026-11-11, «نفس التصميم ولكن 6 اعمدة تحت كل عمود عناصرة»): the same frame and tab look, in six columns - each
   kind's title on top and its figures listed under it. */
.cc-trace-pick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 0; }
.cc-trace-pick .grp { min-width: 0; padding: 10px 4px 6px; }
.cc-trace-pick .grp + .grp { border-inline-start: 1px solid var(--p-line-soft); }
.cc-trace-pick .head { padding: 0 10px 4px; }
.cc-trace-pick .items { flex-direction: column; flex-wrap: nowrap; }
.cc-trace-pick a { display: flex; height: auto; min-height: 38px; padding: 6px 10px; white-space: normal; line-height: 1.35; }
@media (max-width: 1100px) { .cc-trace-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cc-trace-pick .grp:nth-child(3n+1) { border-inline-start: 0; } .cc-trace-pick .grp:nth-child(n+4) { border-top: 1px solid var(--p-line-soft); } }
@media (max-width: 640px) { .cc-trace-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cc-trace-pick .grp { border-inline-start: 1px solid var(--p-line-soft); border-top: 0; } .cc-trace-pick .grp:nth-child(2n+1) { border-inline-start: 0; } .cc-trace-pick .grp:nth-child(n+3) { border-top: 1px solid var(--p-line-soft); } }


/* ── DRWREV: the drawings' technical review (PortalDrawingReview + its dialogs) ── */
.rv-card { padding: 0; overflow: hidden; }
.rv-card > .rv-filters, .rv-card > .rv-check-head, .rv-card > h2, .rv-card > .rv-empty, .rv-card > p, .rv-card > ol { padding-inline: 18px; }
.rv-empty { padding: 26px 18px; margin: 0; }
.rv-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-block: 14px; border-bottom: 1px solid var(--p-line-soft); }
.rv-filter { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--p-line); background: var(--p-surface); color: var(--p-text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.rv-filter .n { font-weight: 700; color: var(--p-ink); }
.rv-filter.on { background: var(--p-primary); border-color: var(--p-primary); color: #fff; }
.rv-filter.on .n { color: #fff; }
.rv-search { max-width: 320px; margin-inline-start: auto !important; }
.rv-table-wrap { overflow-x: auto; }
.rv-table td { padding: 10px 14px; font-size: 13.5px; }
.rv-table th { white-space: nowrap; }
.rv-table tr.sel { background: var(--p-accent-soft); }
.rv-table tr.legacy td { color: var(--p-muted); }
.rv-table .rv-sub, .rv-table td .d { display: block; font-size: 12px; color: var(--p-muted); margin-top: 2px; }
.rv-table tr.rv-group td { background: var(--p-primary-soft); color: var(--p-primary); font-weight: 700; font-size: 12.5px; padding: 6px 14px; cursor: default; }
.rv-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rv-dot.s1, .rv-sev.s1.on, .rv-sev-badge.s1 { background: #D92D20; color: #fff; }
.rv-dot.s2, .rv-sev.s2.on, .rv-sev-badge.s2 { background: #EF6820; color: #fff; }
.rv-dot.s3, .rv-sev.s3.on, .rv-sev-badge.s3 { background: #E5A91A; color: #3D2A00; }
.rv-dot.s4, .rv-sev.s4.on, .rv-sev-badge.s4 { background: #98A2B3; color: #fff; }
.rv-sev-badge { display: inline-block; border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rv-status { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--t-neutral-bg); color: var(--t-neutral-fg); }
.rv-status.st1 { background: var(--t-revise-bg); color: var(--t-revise-fg); }
.rv-status.st2 { background: var(--t-review-bg); color: var(--t-review-fg); }
.rv-status.st3 { background: var(--t-consultant-bg); color: var(--t-consultant-fg); }
.rv-status.st4 { background: var(--t-neutral-bg); color: var(--t-neutral-fg); text-decoration: line-through; }
.rv-status.st5 { background: var(--t-approved-bg); color: var(--t-approved-fg); }
.rv-late { color: #B42318 !important; font-weight: 700; }
.rv-detail { margin-top: 14px; }
.rv-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rv-detail-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; }
.rv-dl { margin: 12px 0 !important; }
.rv-h { font-size: 13px; color: var(--p-primary); margin: 14px 0 4px; }
.rv-h2 { font-size: 15px; color: var(--p-primary); margin: 16px 0 8px; padding-top: 4px; }
.rv-text { white-space: pre-line; line-height: 1.8; margin: 0; }
.rv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--p-line-soft); }
.rv-timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--p-line); }
.rv-timeline li { position: relative; padding: 6px 14px 8px; font-size: 13px; }
.rv-timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--p-action); }
.rv-timeline li.denied::before { background: #D92D20; }
.rv-timeline li.denied { color: #912018; }
.rv-timeline .when { color: var(--p-muted); margin-inline-end: 8px; font-size: 12px; direction: ltr; unicode-bidi: isolate; }
.rv-timeline .what, .rv-timeline .why { display: block; color: var(--p-muted); font-size: 12.5px; }
.rv-check-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-block: 12px; border-bottom: 1px solid var(--p-line-soft); font-size: 13px; color: var(--p-text); }
.rv-ready, .rv-readiness { font-weight: 700; }
.rv-ready.ok, .rv-readiness.ok { color: #05603A; }
.rv-ready.no, .rv-readiness.no { color: #9C2A10; }
.rv-readiness { margin: 0 0 10px; font-size: 13px; }
.rv-must { color: #D92D20; font-weight: 800; margin-inline-start: 3px; }
.rv-results { display: inline-flex; border: 1px solid var(--p-line); border-radius: 8px; overflow: hidden; }
.rv-results .rv-res { border: 0; border-inline-start: 1px solid var(--p-line); border-radius: 0; }
.rv-results .rv-res:first-child { border-inline-start: 0; }
.rv-res { font: inherit; font-size: 12px; padding: 5px 9px; background: var(--p-surface); color: var(--p-text); cursor: pointer; white-space: nowrap; border-radius: 6px; display: inline-block; }
.rv-res:disabled { cursor: default; opacity: .6; }
.rv-res.on.Compliant { background: #12A05C; color: #fff; }
.rv-res.on.NonCompliant { background: #D92D20; color: #fff; }
.rv-res.on.RequiresClarification { background: #E59A1A; color: #fff; }
.rv-res.on.NotApplicable { background: #667085; color: #fff; }
.rv-res.on.NotReviewed { background: var(--t-neutral-bg); color: var(--t-neutral-fg); }
.rv-link { color: var(--p-action); font-weight: 600; text-decoration: none; }
.rv-link.dead { color: #B42318; text-decoration: line-through; }
.rv-path { list-style: none; margin: 0 0 8px; padding-block: 4px; }
.rv-path li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.rv-path li .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; border: 2px solid var(--p-line); background: var(--p-surface); }
.rv-path li.done .dot { background: #12A05C; border-color: #12A05C; }
.rv-path li.current .dot { background: var(--p-accent); border-color: var(--p-accent-dark); box-shadow: 0 0 0 4px var(--p-accent-soft); }
.rv-path li div { display: flex; flex-direction: column; }
.rv-path li .p-muted { font-size: 12.5px; }
.rv-code { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 6px; font-weight: 800; font-size: 14px; color: #fff; background: #667085; }
.rv-code.cA { background: #12A05C; } .rv-code.cB { background: #2E6BE6; } .rv-code.cC { background: #EF6820; } .rv-code.cD { background: #D92D20; }
.rv-decide { display: grid; gap: 8px; }
.rv-decide-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--p-line); border-radius: 8px; background: var(--p-surface); padding: 8px 10px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--p-ink); cursor: pointer; text-align: start; }
.rv-decide-btn:hover:not(:disabled) { border-color: var(--p-action); background: var(--p-action-soft); }
.rv-decide-btn:disabled { opacity: .5; cursor: not-allowed; }
.rv-issues { margin-top: 12px; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.rv-issues ul { margin: 6px 0 0; padding-inline-start: 18px; }
.rv-issues.block { background: var(--t-rejected-bg); color: var(--t-rejected-fg); }
.rv-issues.warn { background: var(--t-consultant-bg); color: var(--t-consultant-fg); }
.rv-voters { list-style: none; margin: 0; padding: 0; }
.rv-voters li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--p-line-soft); font-size: 13px; }
.rv-voters li:last-child { border-bottom: 0; }
.rv-vote { font-weight: 700; font-size: 12px; }
.rv-vote.Approved { color: #05603A; } .rv-vote.Rejected { color: #912018; } .rv-vote.ReturnRecommended { color: #9C2A10; } .rv-vote.none { color: var(--p-muted); }
.rv-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rv-form .rv-wide, .rv-form .rv-sev-pick { grid-column: 1 / -1; }
.rv-sev-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rv-sev-label { font-size: 13px; color: var(--p-muted); margin-inline-end: 6px; }
.rv-sev { font: inherit; font-size: 13px; border: 1px solid var(--p-line); background: var(--p-surface); color: var(--p-text); border-radius: 999px; padding: 4px 14px; cursor: pointer; }
.rv-sev.on { border-color: transparent; font-weight: 700; }
@media (max-width: 900px) { .rv-form { grid-template-columns: 1fr; } .rv-search { max-width: none; margin-inline-start: 0 !important; flex-basis: 100%; } }
.rv-viewer { padding: 12px 14px 16px; }
.rv-vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--p-line-soft); margin-bottom: 10px; }
.rv-vfile { max-width: 280px; }
.rv-vgroup { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--p-line); border-radius: 8px; padding: 0 4px; background: var(--p-surface); }
.rv-vpage { font-size: 12.5px; min-width: 48px; text-align: center; color: var(--p-text); direction: ltr; }
.rv-tools { padding: 2px; gap: 2px; }
.rv-tool { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 12.5px; color: var(--p-text); cursor: pointer; }
.rv-tool:hover:not(:disabled) { background: var(--p-action-soft); }
.rv-tool.on { background: var(--p-primary); color: #fff; }
.rv-tool:disabled { opacity: .45; cursor: not-allowed; }
.rv-vswitch { margin: 0 !important; }
.rv-vsel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--p-accent-soft); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
.rv-vstage { position: relative; overflow: auto; max-height: 78vh; border: 1px solid var(--p-line); border-radius: 8px; background: #E9EDF3; direction: ltr; }
.rv-vstage canvas { display: block; background: #fff; }
.rv-vlayer { position: absolute; top: 0; left: 0; touch-action: none; }
.rv-mk { cursor: pointer; }
.rv-mk.other { opacity: .75; }
.rv-mk.sel * { filter: drop-shadow(0 0 3px #C9A24E); }
.rv-mk-text { width: 100%; height: 100%; overflow: hidden; padding: 1px 3px; line-height: 1.25; direction: rtl; font-family: inherit; }
.rv-pin circle { fill: #2E6BE6; stroke: #fff; stroke-width: 2; }
.rv-pin.sev1 circle { fill: #D92D20; } .rv-pin.sev2 circle { fill: #EF6820; } .rv-pin.sev3 circle { fill: #E5A91A; } .rv-pin.sev4 circle { fill: #667085; }
.rv-pin.done circle { fill: #12A05C; }
.rv-pin text { fill: #fff; font-size: 11px; font-weight: 700; pointer-events: none; }
.rv-pin { cursor: pointer; }
.rv-table tr.rv-mine { background: #FFFBEA; }
.rv-me { font-weight: 700; color: var(--p-accent-dark); }
.rv-rev-list { list-style: none; margin: 0; padding: 0; }
.rv-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rv-compare-pane { min-width: 0; }
.rv-compare-pane h3 { font-size: 13px; margin: 0 0 6px; color: var(--p-primary); }
@media (max-width: 1100px) { .rv-compare { grid-template-columns: 1fr; } }

/* owner IPC register (2026-11-13): grouped money columns */
.r-table.r-grouped thead tr.groups th { text-align: center; color: var(--p-primary); font-weight: 700; border-bottom: 1px solid var(--p-line); }
.r-table.r-grouped th, .r-table.r-grouped td.num { white-space: nowrap; }
.r-table.r-grouped .g-start { border-inline-start: 1px solid var(--p-line); }
.r-table.r-grouped thead tr:nth-child(2) th { top: 37px; }
.r-table td.r-strong { font-weight: 700; color: var(--p-ink); }
.r-table .r-sub { color: var(--p-muted); font-size: 11.5px; margin-top: 2px; }
.p-table.r-grouped thead tr.groups th { text-align: center; color: var(--p-primary); font-weight: 700; border-bottom: 1px solid var(--p-line); }
.p-table.r-grouped .g-start { border-inline-start: 1px solid var(--p-line); }
.p-table.p-receivables td.num { font-weight: 500; }
.p-table td.r-strong { font-weight: 700; color: var(--p-ink); }
.p-table .r-sub { color: var(--p-muted); font-size: 11.5px; margin-top: 2px; font-weight: 400; }
.p-table tr.p-row-late td { background: #FFF5F5; }
/* AUDITREAD: a history row's details as label/value pairs (AuditDetails.cs) instead of raw JSON */
.au-kv { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.au-kv span { display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 8px; border-radius: 6px; background: #F3F6FA; border: 1px solid var(--p-line-soft); font-size: 12.5px; color: var(--p-ink); }
.au-kv b { font-weight: 700; color: var(--p-muted); font-size: 11.5px; }

/* ── DRWLOOK (2026-11-17): the drawing review keeps the house page (DocHeader, KPI row, ribbon, side cards) and puts the drawing
   in view above the registers' tabs - a viewer with one bar, a rail of pages / files, the whole sheet fitted, a full-window mode;
   the review path reads as a workflow table ── */
.d-ws:has(.rvx-viewer-card) .d-side { max-height: calc(100vh - 92px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 2px; }
.d-ws:has(.rvx-viewer-card) .d-tabs { margin: 0; }
.d-ws:has(.rvx-viewer-card) .d-tab { padding: 0 10px; gap: 6px; font-size: 13.5px; }
.rvx-tabs-anchor { height: 0; margin: 0 !important; scroll-margin-top: 76px; }
.rv-detail { scroll-margin-top: 130px; }
.rvx-viewer-card { scroll-margin-top: 76px; }

.rvx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--p-line-soft); }
.rvx-bar .rv-vgroup { height: 36px; }
.rvx-bar .rv-vpage { min-width: 44px; }
.rvx-tools .rv-tool { width: 32px; height: 30px; padding: 0; justify-content: center; }
.rvx-toggle { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--p-line); border-radius: 8px; background: var(--p-surface); color: var(--p-text);
    font: inherit; font-size: 12.5px; cursor: pointer; }
.rvx-toggle:hover { background: var(--p-action-soft); }
.rvx-toggle.on { color: var(--p-primary); border-color: var(--p-primary); background: var(--p-primary-soft); font-weight: 600; }
.rvx-toggle:focus-visible, .rvx-thumb:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }
.rvx-grow { flex: 1 1 0; }
.rvx-file { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; font-size: 12.5px; color: var(--p-muted); }
.rvx-file bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rvx-file .mud-icon-root { color: var(--p-accent-dark); flex-shrink: 0; }
.rvx-bar .rv-vfile { max-width: 260px; margin: 0; }
.rvx-sel { margin: 8px 14px 0; }
.rvx-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); height: clamp(440px, calc(100vh - 250px), 1100px); }
.rvx-rail { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--p-line-soft); background: var(--p-surface); }
.rvx-rail-tabs { display: flex; border-bottom: 1px solid var(--p-line-soft); flex-shrink: 0; }
.rvx-rail-tabs button { flex: 1; height: 36px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--p-muted); cursor: pointer; border-bottom: 2px solid transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.rvx-rail-tabs button.on { color: var(--p-primary); border-bottom-color: var(--p-primary); font-weight: 700; }
.rvx-rail-tabs .n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--p-line-soft); font-size: 11px; display: inline-grid; place-items: center; }
.rvx-thumbs { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.rvx-thumbs[hidden], .rvx-files[hidden] { display: none; }
.rvx-thumb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; font: inherit; }
.rvx-thumb canvas { display: block; width: 116px; min-height: 76px; height: auto; background: #fff; border: 1px solid var(--p-line); border-radius: 4px; }
.rvx-thumb .no { font-size: 11.5px; font-weight: 700; color: var(--p-muted); direction: ltr; }
.rvx-thumb:hover { background: var(--p-line-soft); }
.rvx-thumb.on { border-color: var(--p-accent); background: var(--p-accent-soft); }
.rvx-thumb.on .no { color: var(--p-accent-dark); }
.rvx-thumb .mk { position: absolute; top: 8px; inset-inline-start: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--p-primary); color: #fff; font-size: 11px; font-weight: 700;
    display: inline-grid; place-items: center; }
.rvx-more { margin: 0; font-size: 11.5px; color: var(--p-muted); text-align: center; line-height: 1.6; }
.rvx-files { list-style: none; margin: 0; padding: 8px; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.rvx-files button, .rvx-files a { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: none; font: inherit; font-size: 12px;
    color: var(--p-text); text-decoration: none; cursor: pointer; text-align: start; }
.rvx-files bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rvx-files .mud-icon-root { flex-shrink: 0; font-size: 17px; opacity: .8; }
.rvx-files button:hover, .rvx-files a:hover { background: var(--p-line-soft); }
.rvx-files button.on { background: var(--p-accent-soft); border-color: var(--p-accent); color: var(--p-primary); font-weight: 700; }
.rvx-stage.rv-vstage { display: flex; max-height: none; height: 100%; border: 0; border-radius: 0; }
.rvx-stage canvas { margin: auto; flex-shrink: 0; box-shadow: 0 1px 4px rgba(15, 42, 79, .16); }
.rvx-file-acts { white-space: nowrap; text-align: end; }
.rvx-left { display: block; font-size: 12px; font-weight: 600; color: var(--p-muted); }
.rvx-left.late { color: var(--t-rejected-fg); }
.rvx-votes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.rvx-votes li { display: flex; justify-content: space-between; gap: 12px; }

/* the viewer over the whole window */
.rvx-viewer.full { position: fixed; inset: 0; z-index: 1350; background: var(--p-surface); display: flex; flex-direction: column; }
.rvx-viewer.full .rvx-body { flex: 1; height: auto; min-height: 0; }

@media (max-width: 1150px) {
    .d-ws:has(.rvx-viewer-card) .d-side { max-height: none; overflow: visible; }
}
@media (max-width: 760px) {
    .rvx-body { grid-template-columns: minmax(0, 1fr); height: auto; }
    .rvx-rail { border-inline-end: 0; border-bottom: 1px solid var(--p-line-soft); }
    .rvx-thumbs { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; }
    .rvx-thumb canvas { width: 84px; min-height: 56px; }
    .rvx-stage.rv-vstage { height: 70vh; }
    .rvx-viewer.full .rvx-stage.rv-vstage { height: auto; flex: 1; }
}
@media print { .rvx-bar, .rvx-rail { display: none; } }

/* AIVIS: the AI cards and buttons show only to a user who holds «استخدام الذكاء الاصطناعي» - the layout sets p-ai-on once the Api
   says so (AiAccess). Hidden until then, so they never flash for anyone else. The Api refuses the calls regardless. */
.p-shell:not(.p-ai-on) :is(.r-ai-btn, .r-ai, .d-ai, .h-ai-grid, .h-ai-brief, .h-ask, .h-bar-ask) { display: none !important; }

/* DASHPRO (2026-11-18): the home page - scope picker, area tabs, the procedures map, bottlenecks, weekly trend, latest moves. */
.hd-ask { flex: 1 1 300px; max-width: 460px; margin-inline-start: 0; }
.hd-scope { height: 42px; border: 1px solid var(--p-line); border-radius: 10px; background: var(--p-surface); color: var(--p-ink); font: inherit; font-size: 14px; padding: 0 10px; max-width: 260px; }
.hd-scope:focus { outline: 2px solid var(--p-accent); outline-offset: 1px; }
.hd-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.hd-kpis .p-kpi .ico { width: 48px; height: 48px; }
.hd-kpis .p-kpi .ico .mud-icon-root { font-size: 24px; }
.hd-ai { margin-bottom: 14px; }
.hd-ai > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--p-line); border-radius: 999px; background: var(--p-surface); color: var(--p-ai, #6D4AFF); font-size: 13.5px; font-weight: 600; }
.hd-ai > summary::-webkit-details-marker { display: none; }
.hd-ai[open] > summary { margin-bottom: 10px; }
.p-shell:not(.p-ai-on) .hd-ai { display: none !important; }
.hd-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--p-line-soft); }
.hd-tabs.mb-3 { padding: 0; border-bottom: none; }
.hd-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--p-line); border-radius: 999px; background: var(--p-surface); color: var(--p-text); font: inherit; font-size: 13px; cursor: pointer; }
.hd-tabs button b { font-weight: 700; color: var(--p-muted); font-variant-numeric: tabular-nums; }
.hd-tabs button:hover { border-color: var(--p-primary); }
.hd-tabs button.on { background: var(--p-primary); border-color: var(--p-primary); color: #FFFFFF; }
.hd-tabs button.on b { color: var(--p-accent); }
.hd-tabs button.warn:not(.on) { border-color: #F1B4B4; }
.hd-tabs button .mud-icon-root { font-size: 16px; }
.h-doc-main small { color: var(--p-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.hd-more { display: block; padding: 10px 14px; font-size: 13px; color: var(--p-action); text-decoration: none; border-top: 1px solid var(--p-line-soft); }
.hd-more:hover { text-decoration: underline; }
.hd-proc { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 8px; }
.hd-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hd-proc-table td.num, .hd-proc-table th { text-align: center; }
.hd-proc-table th:first-child, .hd-proc-table td:first-child, .hd-proc-table td:last-child, .hd-proc-table th:last-child { text-align: start; }
.hd-proc-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hd-proc-table td.neg { color: #B42318; font-weight: 700; }
.hd-proc-table td.muted small, .hd-proc-table td small { color: var(--p-muted); font-size: 12px; }
.hd-bar-col { width: 22%; min-width: 120px; }
.hd-stack { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--p-line-soft); gap: 2px; }
.hd-stack i { display: block; min-width: 6px; }
.hd-stack i.empty { flex-grow: 1; background: var(--p-line-soft); }
.hd-stack i.ok, .hd-legend i.ok { background: #1F9D55; }
.hd-stack i.late, .hd-legend i.late { background: #E04848; }
.hd-stack i.none, .hd-legend i.none { background: #A9B7CB; }
.hd-legend { display: inline-flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #A9B7CB; margin-inline-start: auto; }
.hd-legend span { display: inline-flex; align-items: center; gap: 5px; }
.hd-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hd-legend.center { justify-content: center; width: 100%; color: var(--p-muted); margin-top: 8px; }
.hd-legend i.in { background: #1F6FD1; }
.hd-neck { list-style: none; margin: 0; padding: 0; }
.hd-neck li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--p-line-soft); }
.hd-neck li:last-child { border-bottom: none; }
.hd-neck .m { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hd-neck .m b { font-size: 13.5px; font-weight: 600; color: var(--p-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-neck .m small { font-size: 12px; color: var(--p-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-neck .c { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.hd-neck .c b { font-size: 18px; font-weight: 700; color: var(--p-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.hd-neck .c small { font-size: 11.5px; color: var(--p-muted); white-space: nowrap; }
.hd-neck .c small.neg { color: #B42318; font-weight: 600; }
.hd-weeks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 140px; }
.hd-weeks .wk { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.hd-weeks .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.hd-weeks .bars i { display: block; width: 38%; max-width: 14px; border-radius: 3px 3px 0 0; }
.hd-weeks .bars i.in { background: #1F6FD1; }
.hd-weeks .bars i.ok { background: #1F9D55; }
.hd-weeks small { font-size: 11px; color: var(--p-muted); font-variant-numeric: tabular-nums; }
.hd-modules { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.hd-modules .p-module { padding: 16px 18px; }
.hd-modules .hd-new { align-self: flex-start; }
.hd-feed { list-style: none; margin: 0; padding: 4px 0; }
.hd-feed li { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--p-line-soft); }
.hd-feed li:last-child { border-bottom: none; }
.hd-feed .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.hd-feed .dot .mud-icon-root { font-size: 17px; }
.hd-feed .dot.green { background: #E1F5EE; color: #085041; }
.hd-feed .dot.red { background: #FCEBEB; color: #791F1F; }
.hd-feed .dot.amber { background: #FAEEDA; color: #633806; }
.hd-feed .dot.blue { background: #E6F0FB; color: #1F6FD1; }
.hd-feed .dot.gray { background: var(--p-line-soft); color: var(--p-muted); }
.hd-feed .m { display: flex; flex-direction: column; min-width: 0; flex: 1; text-decoration: none; color: var(--p-text); }
.hd-feed .m .t { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-feed .m .t b { color: var(--p-ink); }
.hd-feed .m small { font-size: 12px; color: var(--p-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-feed .m:hover .t { color: var(--p-action); }
.hd-feed time { font-size: 12px; color: var(--p-muted); white-space: nowrap; flex-shrink: 0; }
@media (max-width: 1100px) { .hd-proc { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .hd-ask, .hd-scope { max-width: none; flex: 1 1 100%; } .hd-bar-col { display: none; } }
/* DASHPRO-3: one-row head actions, six indicators in a row on wide screens, the idle-kinds toggle */
.p-header:has(.hd-ask) { flex-wrap: wrap; }
.p-header:has(.hd-ask) .p-header-actions { flex: 1 1 560px; justify-content: flex-end; flex-wrap: nowrap; }
.p-header:has(.hd-ask) .hd-ask { flex: 1 1 240px; max-width: 420px; }
.hd-scope { flex: 0 1 220px; min-width: 150px; }
@media (min-width: 1360px) { .hd-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 900px) and (max-width: 1359px) { .hd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hd-kpis .p-kpi { padding: 14px 16px; gap: 10px; }
.hd-kpis .p-kpi .label { font-size: 14px; }
.hd-kpis .p-kpi .hint { font-size: 12px; }
@media (min-width: 1360px) { .hd-kpis .p-kpi .ico { width: 40px; height: 40px; } .hd-kpis .p-kpi .ico .mud-icon-root { font-size: 21px; } }
button.hd-more { width: 100%; text-align: start; background: none; border: none; border-top: 1px solid var(--p-line-soft); font: inherit; font-size: 13px; cursor: pointer; }
@media (max-width: 760px) { .p-header:has(.hd-ask) .p-header-actions { flex-wrap: wrap; } }

/* ── NAVLOOK (2026-11-18): sidebar polish - deeper navy with a gold glow, a solid gold «طلب جديد», icons on tiles, sections under a heading,
   an open section framed with its screens, a brighter active screen ── */
.p-sidebar.mud-drawer { background: radial-gradient(140% 38% at 50% 0%, rgba(201, 162, 78, .10) 0%, rgba(201, 162, 78, 0) 70%), linear-gradient(180deg, #0D2342 0%, #0A1B33 100%) !important;
    box-shadow: -1px 0 0 rgba(255, 255, 255, .04) inset; }
.p-sidebar .mud-drawer-content { gap: 12px; }
.p-brand { padding: 20px 6px 16px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.p-brand-logo { width: 132px; }
.p-brand-sub { margin-top: 8px; font-size: 12px; color: #93A4BD; letter-spacing: .2px; }
.p-new-btn { height: 42px; padding: 0 14px; border: none; border-radius: 11px; font-size: 14.5px; color: #0B1F3A;
    background: linear-gradient(180deg, #D8B866 0%, #C9A24E 100%); box-shadow: 0 8px 18px -10px rgba(201, 162, 78, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
    transition: filter .15s, transform .15s; }
.p-new-btn:hover { background: linear-gradient(180deg, #E0C273 0%, #CFA954 100%); filter: brightness(1.03); }
.p-new-btn:active { transform: translateY(1px); }
.p-new-btn .mud-icon-root { color: #0B1F3A; }
.p-nav-filter { height: 36px; padding: 0 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); }
.p-nav-filter:focus-within { outline: none; border-color: rgba(201, 162, 78, .55); background: rgba(255, 255, 255, .07); }
.p-nav-fold { width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .07); }

/* the rows: icon on a tile, a little more air */
.p-sidebar .p-nav { gap: 2px; scrollbar-color: transparent transparent; }
.p-sidebar .p-nav:hover { scrollbar-color: rgba(255, 255, 255, .16) transparent; }
.p-nav-row .p-nav-item, .p-nav-group { min-height: 38px; padding: 5px 8px; gap: 10px; border-radius: 10px; }
.p-nav-item > .mud-icon-root:first-child, .p-nav-group > .mud-icon-root:first-child {
    box-sizing: border-box; width: 28px; height: 28px; padding: 5px; flex-shrink: 0; border-radius: 9px;
    background: rgba(255, 255, 255, .06); color: #B4C2D6; transition: background .15s, color .15s; }
.p-nav-item:hover > .mud-icon-root:first-child, .p-nav-group:hover > .mud-icon-root:first-child { background: rgba(255, 255, 255, .1); color: #FFFFFF; }
.p-nav-item.active { background: linear-gradient(270deg, rgba(36, 92, 160, .55) 0%, rgba(36, 92, 160, .22) 100%); color: #FFFFFF; box-shadow: inset -3px 0 0 var(--p-accent); }
.p-nav-item.active > .mud-icon-root:first-child { background: var(--p-accent); color: #0B1F3A; }
.p-nav-group.current { color: #FFFFFF; }
.p-nav-group.current > .mud-icon-root:first-child { background: rgba(201, 162, 78, .18); color: var(--p-accent); }
.p-nav-count { min-width: 20px; padding: 0 6px; line-height: 20px; font-size: 11.5px; background: #E5484D; box-shadow: 0 0 0 2px rgba(11, 31, 58, .9); }

/* the sections' heading and the count of screens */
.p-nav-section { padding: 16px 10px 6px; font-size: 11.5px; font-weight: 700; color: #7186A3; letter-spacing: .4px; display: flex; align-items: center; gap: 8px; }
.p-nav-section::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .07); }
.p-nav-n { min-width: 20px; padding: 0 6px; border-radius: 999px; line-height: 18px; font-size: 11px; font-weight: 700; text-align: center;
    color: #8FA0B8; background: rgba(255, 255, 255, .05); opacity: 0; transition: opacity .15s; }
.p-nav-group:hover .p-nav-n, .p-nav-group.open .p-nav-n { opacity: 1; }
.p-nav-chev { color: #6F84A1 !important; font-size: 18px !important; }

/* an open section: framed together with its screens */
.p-nav-block { border-radius: 12px; transition: background .15s; }
.p-nav-block.open { background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); padding-bottom: 4px; margin: 2px 0; }
.p-nav-block.open > .p-nav-group:hover { background: rgba(255, 255, 255, .04); }
.p-nav-sub { margin: 0 23px 0 6px; padding-inline-start: 10px; border-inline-start: 1px solid rgba(255, 255, 255, .1); gap: 1px; }
.p-nav-sub .p-nav-row .p-nav-item { min-height: 34px; padding: 5px 8px; font-size: 13.5px; font-weight: 600; color: #BCC8D8; border-radius: 9px; }
.p-nav-sub .p-nav-item > .mud-icon-root:first-child { width: 18px; height: 18px; padding: 0; background: none; color: #8FA0B8; }
.p-nav-sub .p-nav-item:hover { color: #FFFFFF; background: rgba(255, 255, 255, .05); }
.p-nav-sub .p-nav-item.active { background: rgba(36, 92, 160, .45); box-shadow: none; position: relative; }
.p-nav-sub .p-nav-item.active::before { content: ""; position: absolute; inset-inline-start: -14px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
    border-radius: 50%; background: var(--p-accent); box-shadow: 0 0 0 3px rgba(201, 162, 78, .2); }
.p-nav-sub .p-nav-item.active > .mud-icon-root:first-child { background: none; color: var(--p-accent); }

/* the foot: help centre as a quiet row */
.p-nav-foot { padding-top: 10px; border-top-color: rgba(255, 255, 255, .06); }
.p-nav-foot .p-nav-item { color: #A9B7CB; }


/* NAVPERM: a screen the user holds no permission for - shown dimmed and not opened (sidebar, rail, tab strip, «الأدوات») */
.p-nav-item.locked, .p-rail-item.locked { opacity: .42; cursor: not-allowed; }
.p-nav-item.locked:hover, .p-rail-item.locked:hover { background: transparent; color: inherit; }
.p-nav-item.locked .p-nav-lock { margin-inline-start: auto; font-size: 14px; }
.p-section-tabs span.locked, .p-tools-grid span.locked { opacity: .45; cursor: not-allowed; display: inline-flex; align-items: center; gap: 4px; }

/* DELEG (D-042): «تفويض الصلاحيات» form and «صلاحيات فريقي» matrix */
.dl-form { margin-bottom: 16px; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 12px 16px; }
.dl-grid .dl-wide { grid-column: 1 / -1; }
.dl-check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dl-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; padding: 0 16px 12px; }
.dl-pick { border: 1px solid var(--p-line, #E3E8F0); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dl-pick-head { display: flex; justify-content: space-between; align-items: baseline; }
.dl-list { max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.dl-list label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.dl-note { padding: 0 16px; }
.dl-matrix th { white-space: normal; min-width: 130px; font-size: 12px; }
.dl-cell { display: flex; align-items: center; gap: 6px; }
.dl-state.on { color: #1F9D55; }
.dl-state.off { color: #9AA6B8; }
.dl-effect { min-width: 120px; padding: 4px 6px; font-size: 12px; }
/* WEBTASKS-ROW: a linked task title is an inline span inside its link, so the ellipsis never applied and a long subject ran under the row buttons. */
.p-task .p-row-main a { display: block; min-width: 0; }
.p-task .p-row-main a .t { display: block; }
/* TASKCARDS: «مهامي» - urgency cards (filters), document-type chips, and the wait badge of each task. */
.p-kpis.p-task-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .p-kpis.p-task-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.p-task-types { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.p-task-type { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--p-line, #DDE2EA); background: #FFFFFF; font: inherit; font-size: 13px; font-weight: 600; color: var(--p-text, #2B3445); cursor: pointer; }
.p-task-type b { font-weight: 700; color: var(--p-muted, #6B778C); font-variant-numeric: tabular-nums; }
.p-task-type:hover { border-color: #1F6FD1; }
.p-task-type.on { border-color: #1F6FD1; background: #EAF2FD; color: #0F4C9C; }
.p-task-type.on b { color: #0F4C9C; }
.p-task-type:focus-visible { outline: 2px solid var(--p-accent, #1F6FD1); outline-offset: 2px; }
.p-task-due { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.p-task-due.red { background: #FDECEC; color: #B42318; border-color: #F5C2C0; }
.p-task-due.amber { background: #FFF4E0; color: #8A5200; border-color: #F3D19C; }
.p-task-due.green { background: #E7F6EC; color: #17713F; border-color: #B7E0C5; }
.p-task-due.gray { background: #F1F3F7; color: #55617A; border-color: #DDE2EA; }
@media (max-width: 700px) { .p-task-due { order: 3; } }
/* TASKCARDS-2: the project filter above the «مهامي» cards. */
.p-toolbar.p-task-bar { justify-content: flex-start; margin-bottom: 12px; }
.p-task-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--p-text, #2B3445); }
.p-task-pick .p-select { min-width: 280px; max-width: 100%; height: 38px; font-weight: 600; }
@media (max-width: 700px) { .p-task-pick { width: 100%; } .p-task-pick .p-select { flex: 1; min-width: 0; } }
/* TASKFIND: the «مهامي» bar (search, project, clear) and the page on a phone - the title on two lines beside its icon,
   then the wait badge and the buttons on one line. */
.p-task-bar .p-search.grow { flex: 1 1 280px; }
@media (max-width: 700px) {
  .p-task { padding: 12px 14px; row-gap: 8px; }
  .p-task .p-row-main { flex: 1 1 calc(100% - 44px); }
  .p-task .p-row-main .t, .p-task .p-row-main a .t { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .p-task-due { order: 2; }
  .p-task .p-task-actions { order: 3; width: auto; flex: 1 1 auto; justify-content: flex-end; flex-wrap: wrap; }
  .p-task-types { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .p-task-type { flex-shrink: 0; }
  .p-task-bar .p-search.grow { flex-basis: 100%; }
}
/* WEBSENT: the two lists of «مهامي» as tabs (buttons in the look of .p-tabs links). */
.p-tabs.p-task-tabs { display: inline-flex; max-width: 100%; margin-bottom: 14px; }
.p-tabs button { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border: none; background: none; border-radius: 9px; color: var(--p-muted, #6B778C); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; }
.p-tabs button b { font-variant-numeric: tabular-nums; padding: 1px 8px; border-radius: 999px; background: var(--p-line-soft, #EEF1F6); color: var(--p-ink, #0F2A4F); font-size: 12.5px; }
.p-tabs button:hover { background: var(--p-line-soft, #EEF1F6); color: var(--p-ink, #0F2A4F); }
.p-tabs button.on { background: var(--p-nav, #0F2A4F); color: #FFFFFF; box-shadow: inset 0 -3px 0 var(--p-accent, #E8962E); }
.p-tabs button.on b { background: rgba(255, 255, 255, .18); color: #FFFFFF; }
.p-tabs button:focus-visible { outline: 2px solid var(--p-accent, #E8962E); outline-offset: 1px; }
/* TASKPEEK: the side preview of a task in «مهامي» - a panel on the end side over a dimmed page. */
.p-task-peek { flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--p-line, #DDE2EA); border-radius: 8px; background: #FFFFFF; color: var(--p-muted, #6B778C); cursor: pointer; }
.p-task-peek:hover { border-color: #1F6FD1; color: #1F6FD1; background: #EAF2FD; }
.p-task-peek:focus-visible { outline: 2px solid var(--p-accent, #E8962E); outline-offset: 1px; }
.p-peek-back { position: fixed; inset: 0; background: rgba(10, 27, 54, .38); z-index: 1300; }
.p-peek { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(560px, 100vw); z-index: 1301; display: flex; flex-direction: column; background: #F6F8FB; box-shadow: 0 0 40px rgba(10, 27, 54, .28); animation: p-peek-in .16s ease-out; }
@keyframes p-peek-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .p-peek { animation: none; } }
.p-peek-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 16px; background: var(--p-nav, #0F2A4F); color: #FFFFFF; }
.p-peek-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.p-peek-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: #C9D6EA; }
.p-peek-head h2 { margin: 0; font-size: 17px; line-height: 1.5; font-weight: 700; color: #FFFFFF; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.p-peek-no { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: #DCE5F3; }
.p-peek-close { flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; border: none; border-radius: 8px; background: rgba(255, 255, 255, .12); color: #FFFFFF; cursor: pointer; }
.p-peek-close:hover { background: rgba(255, 255, 255, .24); }
.p-peek-close:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 1px; }
.p-peek-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.p-peek-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 16px; background: #FFFFFF; border: 1px solid var(--p-line, #DDE2EA); border-radius: 12px; }
.p-peek-facts dt { font-size: 12px; color: var(--p-muted, #6B778C); margin-bottom: 2px; }
.p-peek-facts dd { margin: 0; font-size: 14px; font-weight: 700; color: var(--p-ink, #0F2A4F); overflow-wrap: anywhere; }
.p-peek-sec { padding: 14px 16px; background: #FFFFFF; border: 1px solid var(--p-line, #DDE2EA); border-radius: 12px; }
.p-peek-sec h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--p-ink, #0F2A4F); }
.p-peek-sec p { margin: 0; }
.p-peek-body > .p-card { margin: 0; }
.p-peek-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; background: #FFFFFF; border-top: 1px solid var(--p-line, #DDE2EA); }
.p-peek-foot:empty { display: none; }
@media (max-width: 600px) { .p-peek-facts { grid-template-columns: minmax(0, 1fr); } .p-peek-body { padding: 12px; } .p-peek-head { padding: 14px 14px 12px; } }
/* TASKTABS: the two lists of «مهامي» as a line of tabs - the open one in ink with an accent bar under it and a filled count,
   the other quiet; the line runs the width of the page (replaces the boxed pill of WEBSENT for this page only). */
.p-tabs.p-task-tabs { display: flex; flex-wrap: nowrap; gap: 6px; max-width: none; margin: 0 0 18px; padding: 0; background: none; border: none; border-bottom: 1px solid var(--p-line, #DDE2EA); border-radius: 0; overflow-x: auto; scrollbar-width: none; }
.p-tabs.p-task-tabs::-webkit-scrollbar { display: none; }
.p-tabs.p-task-tabs button { position: relative; gap: 8px; padding: 12px 18px 13px; margin-bottom: -1px; border-radius: 10px 10px 0 0; border-bottom: 3px solid transparent; background: none; color: var(--p-muted, #6B778C); font-size: 15px; font-weight: 700; box-shadow: none; transition: color .12s ease, background-color .12s ease, border-color .12s ease; }
.p-tabs.p-task-tabs button .mud-icon-root { font-size: 20px; color: #9AA6B8; transition: color .12s ease; }
.p-tabs.p-task-tabs button b { min-width: 24px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px; background: #E9EDF3; color: #55617A; font-size: 12.5px; font-weight: 700; line-height: 1; }
.p-tabs.p-task-tabs button:hover { background: #F1F4F9; color: var(--p-ink, #0F2A4F); }
.p-tabs.p-task-tabs button:hover .mud-icon-root { color: #55617A; }
.p-tabs.p-task-tabs button.on { background: none; color: var(--p-ink, #0F2A4F); border-bottom-color: var(--p-accent, #E8962E); box-shadow: none; }
.p-tabs.p-task-tabs button.on .mud-icon-root { color: #1F6FD1; }
.p-tabs.p-task-tabs button.on b { background: var(--p-nav, #0F2A4F); color: #FFFFFF; }
.p-tabs.p-task-tabs button:focus-visible { outline: 2px solid #1F6FD1; outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .p-tabs.p-task-tabs button, .p-tabs.p-task-tabs button .mud-icon-root { transition: none; } }
@media (max-width: 600px) { .p-tabs.p-task-tabs button { flex: 1 1 0; justify-content: center; padding-inline: 10px; font-size: 14px; } }

/* ── PERMTREE (2026-11-20): a role's permission matrix on the sidebar's tree - a section of the menu, its screens as sub-groups ── */
.u-nav-tree .u-sec-name { display: inline-flex; align-items: center; gap: 8px; }
.u-nav-tree .u-sec-name .mud-icon-root { color: var(--p-primary); }
.u-nav-tree details[open] > summary { background: var(--p-bg); }
.u-nav-group { margin: 6px 0 10px; margin-inline-start: 14px; padding-inline-start: 12px; border-inline-start: 2px solid var(--p-line); }
.u-nav-group-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 4px 8px; border-radius: 6px; background: var(--p-bg); font-size: 14px; font-weight: 700; color: var(--p-primary); }
.u-nav-group-head .mud-icon-root { color: var(--p-muted); }
.u-nav-group-count { font-size: 12.5px; font-weight: 400; color: var(--p-muted); }
.u-nav-group-head .p-link-btn { font-size: 12.5px; }
.u-nav-group .u-screens { margin: 6px 0 4px; }
.u-nav-group .u-screen { font-size: 13.5px; }
.u-nav-tree details[open] > summary .u-sec-name { color: var(--p-primary); }

/* ── USEROFF (2026-11-20): a disabled account's row in the users register stands out - a rose wash with a red edge ── */
.r-table tbody tr.u-row-off td { background: #FDF3F3; }
.r-table tbody tr.u-row-off:hover td { background: #FBE9E9; }
.r-table tbody tr.u-row-off td:first-child { box-shadow: inset 4px 0 0 #DC2626; }
[dir="rtl"] .r-table tbody tr.u-row-off td:first-child { box-shadow: inset -4px 0 0 #DC2626; }
.u-row-off .u-who b { color: #991B1B; }
.u-row-off .u-av.off { background: #FBD5D5; color: #991B1B; }
.u-row-off .u-chip { background: #F6E4E4; color: #7F1D1D; }

/* ── HOMEWRAP (2026-11-20): the home page's task and follow-up tables show the whole title - it wraps instead of ending in «…» ── */
.h-doc-main b, .h-doc-main small { white-space: normal; overflow: visible; text-overflow: clip; max-width: none; overflow-wrap: anywhere; line-height: 1.5; }
.h-table .h-wait { white-space: nowrap; }
.h-doc { align-items: flex-start; }

/* ── MIRBOXES (2026-11-21, «تصميم احترافي للصناديق»): the material inspection request's form - numbered section heads, compact boxes ── */
.mi-form .mi-sec { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--p-line-soft); font-size: 15px; font-weight: 700; color: var(--p-primary); }
.mi-form .mi-sec .n { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--p-primary); color: #fff; font-size: 12px; font-weight: 700; }
.mi-form .mi-sec small { margin-inline-start: auto; font-size: 12px; font-weight: 400; color: var(--p-muted); }
.mi-form .p-form-grid { gap: 14px 18px; }
.mi-form .p-form-grid > .mud-input-control { margin: 0; }
.mi-form .mi-span2 { grid-column: span 2; }
.mi-form .mud-input-outlined-border { border-radius: 8px; }
.mi-form .mud-input-control .mud-input-label { font-size: 13.5px; }
.mi-form .mud-input-control.mud-input-control-disabled .mud-input-slot { color: var(--p-ink); -webkit-text-fill-color: var(--p-ink); }
@media (max-width: 900px) { .mi-form .mi-span2 { grid-column: auto; } .mi-form .mi-sec small { display: none; } }
/* MIRBOXES-2: the labels always on the box's top edge (ShrinkLabel) so no icon covers them; one height for every box - the pickers' icon buttons no longer stretch theirs */
.mi-form .mud-input.mud-input-outlined { min-height: 42px; align-items: center; }
.mi-form .mud-input-adornment .mud-icon-button { padding: 4px; margin: 0; }
.mi-form .mud-input-adornment .mud-icon-root { font-size: 20px; }
.mi-form .mud-input > input.mud-input-root, .mi-form .mud-input .mud-input-slot { padding-top: 9px; padding-bottom: 9px; }
.mi-form .mud-input-label-outlined.mud-input-label-inputcontrol { color: var(--p-muted); }
/* MIRBOXES-3: the form's plain fields - the label above the box at a readable size, one 42 px box with a soft border and a focus ring */
.mi-form { display: flex; flex-direction: column; gap: 16px; }
.mi-form .mi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; }
.mi-form .mi-grid .span2 { grid-column: span 2; }
.mi-form .mi-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
.mi-form .mi-field > span { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--p-ink); }
.mi-form .mi-field > span i { color: #C0392B; font-style: normal; font-weight: 700; }
.mi-form .mi-field .mi-count { margin-inline-start: auto; font-size: 12px; font-weight: 700; color: var(--p-primary); background: #EAF1FB; border-radius: 10px; padding: 0 8px; }
.mi-form .mi-in { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #CDD5E0; border-radius: 8px; background: #fff; font: inherit; font-size: 15px; color: var(--p-ink); transition: border-color .15s, box-shadow .15s; }
.mi-form .mi-in::placeholder { color: #9AA6B6; }
.mi-form .mi-in:hover:not(:disabled):not([readonly]) { border-color: #9FB0C6; }
.mi-form .mi-in:focus { outline: none; border-color: var(--p-primary); box-shadow: 0 0 0 3px rgba(31, 78, 140, .15); }
.mi-form .mi-in:disabled, .mi-form .mi-in[readonly] { background: #F4F6F9; color: #5B6B82; cursor: default; }
.mi-form select.mi-in { appearance: none; padding-inline-end: 36px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%278%27 viewBox=%270 0 12 8%27%3E%3Cpath d=%27M1 1l5 5 5-5%27 fill=%27none%27 stroke=%27%235B6B82%27 stroke-width=%271.8%27/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; }
.mi-form input[type=date].mi-in, .mi-form input[type=time].mi-in { direction: rtl; text-align: right; }
@media (max-width: 900px) { .mi-form .mi-grid { grid-template-columns: minmax(0, 1fr); } .mi-form .mi-grid .span2 { grid-column: auto; } }
.mi-form .mi-in, .mi-form .mi-field { box-sizing: border-box; }
/* MIRUNIT: adding a unit of measure in place */
.mi-form .mi-add { display: flex; gap: 8px; align-items: center; }
.mi-form .mi-add .mi-in { flex: 1 1 auto; min-width: 0; }
.mi-form .mi-add .mi-abb { flex: 0 0 90px; }
.mi-form .mi-btn { flex: none; height: 42px; padding: 0 14px; border: 1px solid var(--p-primary); border-radius: 8px; background: var(--p-primary); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.mi-form .mi-btn:disabled { opacity: .5; cursor: default; }
.mi-form .mi-btn.ghost { background: #fff; color: var(--p-primary); }
/* TASKCOLS: the home tasks table - two lines in one cell (main value above, its companion muted below), the value right-aligned */
.h-table .h-two { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.h-table .h-two b { font-weight: 600; font-size: 13px; color: var(--p-ink); white-space: nowrap; }
.h-table .h-two small { font-size: 11.5px; color: var(--p-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.h-table th.num, .h-table td.num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.h-table td.num { font-weight: 600; }
@media (max-width: 1100px) { .h-doc-main b { max-width: 200px; } }
/* ITEMWEB 2026-11-21 «دليل الأصناف»: the category tree beside the items, the item / category forms */
.ic-split { grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); }
.ic-tree-search { padding: 8px 10px; border-bottom: 1px solid var(--p-line-soft); }
.ic-tree-search .p-search { min-width: 0; width: 100%; }
.ic-node { position: relative; }
.ic-node .rl-pick { padding-inline-end: 4px; }
.ic-node-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-lock { color: var(--p-muted); font-size: 15px !important; }
.ic-node-tools { display: none; gap: 0; flex-shrink: 0; }
.ic-node:hover .ic-node-tools, .ic-node:focus-within .ic-node-tools, .ic-node.on .ic-node-tools { display: inline-flex; }
.ic-node:hover em, .ic-node:focus-within em, .ic-node.on em { display: none; }
.ic-mini { display: inline-grid; place-items: center; width: 26px; height: 26px; border: none; border-radius: 6px; background: none; color: var(--p-muted); cursor: pointer; padding: 0; }
.ic-mini:hover { background: var(--p-line-soft); color: var(--p-action); }
.ic-mini.danger:hover { color: #C23434; }
.ic-mini:focus-visible { outline: 2px solid var(--p-action); outline-offset: 1px; }
.ic-head { flex-wrap: wrap; row-gap: 6px; }
.ic-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; }
.ic-crumb { border: none; background: none; font: inherit; font-size: 14px; color: var(--p-muted); padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.ic-crumb:hover { background: var(--p-line-soft); color: var(--p-ink); }
.ic-crumb.on { color: var(--p-ink); font-weight: 700; font-size: 15px; }
.ic-crumb .c { color: var(--p-muted); font-size: 12px; font-weight: 400; }
.ic-sep { color: var(--p-muted); opacity: .6; }
.ic-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--p-line-soft); }
.ic-bar .p-search.grow { flex: 1 1 280px; min-height: 38px; }
.ic-note { margin: 10px 16px 0; }
.ic-table { min-width: 760px; }
.ic-code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--p-action); }
.ic-name { font-weight: 600; }
.ic-desc { font-size: 12px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ic-cat { color: var(--p-muted); font-size: 13px; }
.ic-act { width: 84px; text-align: end; }
.ic-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--p-line-soft); }
.ic-pageno { font-size: 13px; color: var(--p-muted); min-width: 56px; text-align: center; }
@media (max-width: 960px) { .ic-split { grid-template-columns: minmax(0, 1fr); } .ic-node-tools { display: inline-flex; } .ic-node em { display: none; } }
.ie-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ie-code { margin-inline-start: auto; font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 600; color: var(--p-action); background: var(--p-line-soft); border-radius: 6px; padding: 2px 8px; }
.ie-code small { font-family: inherit; font-weight: 400; color: var(--p-muted); }
.ie-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.ie-full { grid-column: 1 / -1; }
.ie-switch { padding-top: 8px; }
@media (max-width: 640px) { .ie-grid { grid-template-columns: minmax(0, 1fr); } }
.ie-dup { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--t-rejected-bg); color: var(--t-rejected-fg); border: 1px solid var(--t-rejected); font-size: 13.5px; }
.ie-dup > div { flex: 1; min-width: 0; }
.ie-similar { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--t-consultant-bg); border: 1px solid var(--t-consultant); font-size: 13.5px; }
.ie-similar-head { display: flex; align-items: center; gap: 6px; color: var(--t-consultant-fg); font-weight: 600; margin-bottom: 6px; }
.ie-similar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ie-similar li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, .6); }
.ie-similar .c { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--p-action); }
.ie-similar .n { font-weight: 600; }
.ie-open { margin-inline-start: auto; border: none; background: none; color: var(--p-action); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.ie-cat-opt { display: flex; align-items: baseline; gap: 8px; }
.ie-cat-opt .c { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--p-muted); min-width: 64px; }
.ie-hint { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--p-muted); }
.ie-hint.warn { color: var(--t-consultant-fg); }
.ie-siblings { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 10px; font-size: 12.5px; }
/* ITEMWEB: the breadcrumb, the head's text button and the tree tools sit on the dark card head */
.ic-head .ic-crumb { color: #A9B7CB; }
.ic-head .ic-crumb:hover { background: rgba(255, 255, 255, .1); color: #FFFFFF; }
.ic-head .ic-crumb.on { color: #FFFFFF; }
.ic-head .ic-crumb .c, .ic-head .ic-sep { color: #8FA0B8; }
.ic-head .ic-crumbs { flex: 1 1 auto; }
.ic-head .mud-button-text { color: #FFFFFF; }
.p-card-head .ic-mini { color: #A9B7CB; }
.p-card-head .ic-mini:hover { background: rgba(255, 255, 255, .1); color: #FFFFFF; }
/* ITEMWEB: MudBlazor dialogs render outside .p-shell, where the colour tokens live, so the form's notices use the colours themselves */
.ie-code { color: #1E4E8C; background: #EEF2F7; }
.ie-code small { color: #64748B; }
.ie-dup { background: #FDECEC; color: #912018; border-color: #D92D20; }
.ie-similar { background: #FFF6E5; border-color: #E59A1A; }
.ie-similar-head, .ie-hint.warn { color: #93370D; }
.ie-similar .c, .ie-open { color: #1E4E8C; }
.ie-cat-opt .c, .ie-hint, .ie-siblings .p-muted { color: #64748B; }
.ie-siblings .p-chip { background: #F2F4F7; color: #667085; border-color: #C0C6D0; }
.ie-code-inline { font-family: ui-monospace, Consolas, monospace; font-weight: 600; color: #1E4E8C; }
/* D-046 (2026-11-22): the MIRBOXES form boxes are the program's identity - the extra pieces every form needs */
.mi-form .mi-grid .span3 { grid-column: 1 / -1; }
.mi-form .mi-hint { font-size: 12.5px; font-weight: 400; color: var(--p-muted); }
.mi-form .mi-hint.warn { color: #B45309; }
.mi-form textarea.mi-in { height: auto; min-height: 42px; padding: 9px 12px; line-height: 1.5; resize: vertical; }
.mi-form .mi-in[type=number] { text-align: start; }
.mi-form .mi-check { flex-direction: row; align-items: center; gap: 10px; min-height: 42px; align-self: end; font-size: 14px; font-weight: 600; color: var(--p-ink); cursor: pointer; }
.mi-form .mi-check input { width: 18px; height: 18px; accent-color: var(--p-primary); }
.mi-form .mi-field > .mud-input-control { margin: 0; }
.mi-form .mi-field .mud-input.mud-input-outlined { min-height: 42px; border-radius: 8px; background: #fff; }
.mi-form .mi-field .mud-input-outlined-border { border-color: #CDD5E0; border-radius: 8px; }
.mi-form .mi-checks { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.mi-form .mi-checks label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.mi-form .mi-checks input { width: 17px; height: 17px; accent-color: var(--p-primary); }
@media (max-width: 900px) { .mi-form .mi-grid .span3 { grid-column: auto; } }
.mi-form .mi-sec .mi-n { font-size: 12px; font-weight: 700; color: var(--p-primary); background: #EAF1FB; border-radius: 10px; padding: 1px 9px; }
.mi-form .mi-sec .mi-tools { margin-inline-start: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; }
.mi-form .mi-sec .mi-tools ~ small, .mi-form .mi-sec small ~ .mi-tools { margin-inline-start: 12px; }
.mi-form .mi-field .mi-auto { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; cursor: pointer; }
.mi-form .mi-in.bad { border-color: #C0392B; background: #FFF8F7; }
.mi-form .mi-in.late { color: #B42318; font-weight: 700; }
/* SECHEAD (user 2026-11-22, «اللون الكحلي المعمول به في راس كل عنوان للفصل بين المجموعات»): every numbered section head of the D-046
   forms is the navy card head - a full-width bar at the top of its card, white title, white number badge, grey hint */
.mi-form .mi-sec { background: var(--p-nav); color: #FFFFFF; min-height: 46px; padding: 9px 18px; border-bottom: 0; font-size: 16.5px; flex-wrap: wrap; }
.mi-form .p-card > .mi-sec:first-child, .mi-form.p-card > .mi-sec:first-child { margin: -20px -22px 18px; }
.mi-form .mi-sec .n { background: #FFFFFF; color: var(--p-nav); }
.mi-form .mi-sec small { color: #A9B7CB; }
.mi-form .mi-sec .mi-n { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.mi-form .mi-sec .mud-button-outlined { color: #FFFFFF; border-color: rgba(255, 255, 255, .35); }
.mi-form .mi-sec .mud-button-outlined:hover { background: rgba(255, 255, 255, .08); }
.mi-form .mi-sec .mud-button-text { color: #FFFFFF; }
.mi-form .mi-sec .mud-button-filled.mud-button-filled-primary { background: var(--p-accent); color: var(--p-nav); }
.mi-form .mi-sec .mud-button-filled.mud-button-filled-primary:hover { filter: brightness(1.06); }
/* SECHEAD-2 (user 2026-11-22, «الدائرة التي فيها الرقم بالرمادي»): the section number in a grey circle */
.mi-form .mi-sec .n { background: #C9D4E3; color: var(--p-nav); }
/* SECHEAD-3 (user 2026-11-22, «عدد العناصر بدل داخل دائرة بين قوسين»): the count beside a section title reads «(3)», no chip */
.mi-form .mi-sec .mi-n { background: none; border-radius: 0; padding: 0; color: #C9D4E3; font-size: 15px; font-weight: 600; }
.mi-form .mi-sec .mi-n::before { content: "("; }
.mi-form .mi-sec .mi-n::after { content: ")"; }
/* DAYFIELD (user 2026-11-22, «التاريخ يوم شهر سنة»): the forms' dates are the DayField (day/month/year, Arabic calendar), drawn as the other boxes */
.mi-form .mi-field .p-dayfield { width: 100%; height: 42px; border: 1px solid #CDD5E0; border-radius: 8px; background: #FFFFFF; box-sizing: border-box; }
.mi-form .mi-field .p-dayfield input { font-size: 15px; padding: 0 12px; }
.mi-form .mi-field .p-dayfield:hover:not(.off) { border-color: #9FB0C6; }
.mi-form .mi-field .p-dayfield:focus-within { border-color: var(--p-primary); box-shadow: 0 0 0 3px rgba(31, 78, 140, .15); }
.mi-form .mi-field .p-dayfield.off { opacity: 1; background: #F4F6F9; }
.mi-form .mi-field.bad .p-dayfield, .mi-form .mi-field .p-dayfield.bad { border-color: #C0392B; background: #FFF8F7; box-shadow: none; }
/* MOBTASKS 2026-11-22: on a phone the home task table squeezed the document column to one letter a line (overflow-wrap:anywhere lets it shrink to a letter). Break only inside a word too long for the cell, and keep the column wide enough; the table then scrolls sideways in .p-grid-edit-wrap */
.h-doc-main b, .h-doc-main small { overflow-wrap: break-word; }
.h-table td:first-child { min-width: 240px; }
@media (max-width: 600px) { .h-table td:first-child { min-width: 200px; } .h-table th, .h-table td { padding: 8px 10px; } }
/* REGBAR-4 (2026-11-22): every register's row-buttons column (DocRowActions) - kept at the table's end while it scrolls sideways */
th.rv-acts-h { text-align: center; position: sticky; inset-inline-end: 0; z-index: 2; background: #F8FAFC; box-shadow: -6px 0 8px -8px rgba(15, 23, 42, .25) inset; }
td.rv-acts { padding-inline: 4px !important; position: sticky; inset-inline-end: 0; z-index: 1; white-space: nowrap; cursor: default; background: #FFFFFF; box-shadow: -6px 0 8px -8px rgba(15, 23, 42, .25) inset; }
tr:hover td.rv-acts { background: #F8FAFC; }
tr.picked td.rv-acts { background: #EEF4FC; }
