
/* ===== V32 Base Layout: official topbar, active nav, messages, responsive shell ===== */

:root {
    --primary: #286f81;
    --primary-dark: #1f5d6c;
    --success: #287a58;
    --warning: #9a6414;
    --danger: #9b2c2c;

    --page-bg: #f3f6f7;
    --surface: #ffffff;
    --border: #dce7eb;
    --text: #253842;
    --muted: #7c8b92;
    --soft: #f7fafb;
    --topbar: #225f70;
    --gold: #d9b45b;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Cairo", "Tahoma", "Arial", sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* Topbar */
.topbar {
    background: var(--topbar);
    color: #fff;
    border-bottom: 4px solid var(--gold);
}

.topbar__inner {
    width: min(1540px, calc(100% - 44px));
    margin: 0 auto;
    min-height: 116px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.topbar__brand-link {
    display: block;
}

.topbar__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, .74);
    font-size: 11px;
    line-height: 1.2;
}

.topbar__title {
    margin: 0;
    color: #fff;
    font-size: 25px;
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: -.2px;
}

.topbar__subtitle {
    margin: 5px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: 12.5px;
    line-height: 1.7;
}

.topbar__nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.topbar__nav a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    color: rgba(255, 255, 255, .88);
    background: rgba(255, 255, 255, .05);
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.topbar__nav a:hover {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
}

.topbar__nav a.active {
    background: #fff;
    border-color: #fff;
    color: var(--primary-dark);
}

/* Page shell */
.page {
    width: min(1540px, calc(100% - 44px));
    margin: 28px auto 42px;
}

/* System messages */
.system-messages {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.system-message {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    padding: 10px 12px;
    font-size: 12.8px;
    line-height: 1.7;
}

.system-message--success {
    border-color: #cfe8dc;
    background: #f3fbf6;
    color: #216345;
}

.system-message--warning {
    border-color: #f1d9ad;
    background: #fff8ed;
    color: #8a5a00;
}

.system-message--error,
.system-message--danger {
    border-color: #f0c8c8;
    background: #fff4f4;
    color: #8f2525;
}

.system-message--info,
.system-message--debug {
    border-color: #d8e8ee;
    background: #f5fafc;
    color: var(--primary-dark);
}

/* Shared utilities */
.empty {
    color: var(--muted);
    text-align: center;
}

.messages {
    display: none;
}

/*
مهم:
تم إخفاء .messages لأن بعض القوالب القديمة تعرض رسائلها محليًا.
الرسائل الآن تظهر من base.html داخل .system-messages حتى لا تتكرر.
*/

/* Responsive */
@media (max-width: 920px) {
    .topbar__inner {
        width: calc(100% - 24px);
        min-height: auto;
        padding: 18px 0;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .topbar__title {
        font-size: 21px;
    }

    .topbar__nav {
        justify-content: flex-start;
    }

    .topbar__nav a {
        flex: 1 1 auto;
    }

    .page {
        width: calc(100% - 24px);
        margin-top: 18px;
    }
}

@media print {
    .topbar,
    .system-messages {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .page {
        width: 100%;
        margin: 0;
    }
}

@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap");

:root {
    --bg: #f5f7f8;
    --card: #ffffff;
    --text: #1f2f3a;
    --muted: #667780;
    --line: #e4e9ec;
    --primary: #2f7188;
    --primary-dark: #24596b;
    --accent: #d7b84f;
    --soft: #edf5f7;
    --success: #287d53;
    --warning: #a66b00;
    --shadow: 0 10px 30px rgba(22, 50, 65, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 400;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-bottom: 4px solid var(--accent);
}

.topbar__inner {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.topbar__title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.topbar__subtitle {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar__nav a {
    padding: 8px 12px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
}

.topbar__nav a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.page {
    width: min(1320px, calc(100% - 40px));
    margin: 28px auto 60px;
}

.hero {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.hero--stage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.hero h2 {
    margin: 8px 0 8px;
    font-size: 26px;
    font-weight: 600;
}

.hero p {
    margin: 0;
    color: var(--muted);
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.kpi-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.kpi-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.kpi-card strong {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-dark);
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.panel__header h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
}

.panel__header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn--secondary {
    background: #eef3f5;
    color: var(--primary-dark);
}

.btn--secondary:hover {
    background: #dfeaec;
}

.btn--full {
    width: 100%;
}

.link {
    color: var(--primary-dark);
    font-weight: 600;
}

.link:hover {
    text-decoration: underline;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th {
    background: #f2f6f7;
    color: #405762;
    font-weight: 600;
    font-size: 13px;
    text-align: right;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    color: #2e3d45;
    white-space: nowrap;
}

tr:hover td {
    background: #fbfdfe;
}

.strong {
    font-weight: 600;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 30px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
}

.badge--ok {
    background: #eaf7f0;
    color: var(--success);
}

.badge--warn {
    background: #fff4df;
    color: var(--warning);
}

.stage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.stage-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.stage-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stage-number {
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
}

.stage-card h3 {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 600;
}

.stage-meta {
    display: grid;
    gap: 8px;
    color: var(--muted);
    margin-bottom: 16px;
}

.stage-meta strong {
    color: var(--text);
    font-weight: 600;
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.mini-stats div {
    background: #f6fafb;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
}

.mini-stats span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.mini-stats strong {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
}

.workflow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.workflow-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.step {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}

.workflow-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
}

.workflow-card p {
    min-height: 72px;
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.8;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.action-strip {
    background: #f7fafb;
    border: 1px dashed #bfd2da;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.action-strip strong {
    font-size: 16px;
}

.action-strip p {
    margin: 6px 0 0;
    color: var(--muted);
}

@media (max-width: 1100px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .workflow,
    .two-columns,
    .stage-grid {
        grid-template-columns: 1fr;
    }

    .hero--stage,
    .topbar__inner,
    .panel__header,
    .action-strip {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .page,
    .topbar__inner {
        width: min(100% - 24px, 1320px);
    }

    .kpi-grid,
    .mini-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h2 {
        font-size: 22px;
    }

    .topbar__nav {
        flex-wrap: wrap;
    }
}

/* ===== Stage Applications Review Page ===== */

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
}

.filter-pill strong {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f2f6f7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
}

.filter-pill--active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.filter-pill--active strong {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.search-strip {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-strip input[type="search"] {
    flex: 1;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
}

.wide-table th,
.wide-table td {
    font-size: 13px;
}

.note-cell {
    max-width: 280px;
    white-space: normal;
    line-height: 1.7;
}

.muted-text {
    color: var(--muted);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    color: var(--muted);
}

@media (max-width: 800px) {
    .search-strip {
        flex-direction: column;
        align-items: stretch;
    }
}


/* ===== Dense Administrative Table + Separate Detail Page ===== */

.page-titlebar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px 22px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.page-titlebar span {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.page-titlebar h2 {
    margin: 4px 0;
    font-size: 24px;
    font-weight: 600;
}

.page-titlebar p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.page-titlebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.thin-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 14px;
}

.thin-stats span {
    color: var(--muted);
    background: #f7fafb;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
}

.thin-stats strong {
    color: var(--primary-dark);
    font-weight: 700;
}

.compact-controls {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 14px;
    box-shadow: 0 8px 22px rgba(22, 50, 65, 0.05);
}

.compact-controls form {
    display: grid;
    grid-template-columns: 240px 1fr auto auto;
    gap: 8px;
    align-items: center;
}

.compact-controls select,
.compact-controls input {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 7px 11px;
    font-family: inherit;
    background: #fff;
}

.compact-controls div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.compact-controls div a {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
}

.compact-controls div a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.data-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.data-box__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.data-box__head h3 {
    margin: 0 0 3px;
    font-size: 18px;
    font-weight: 600;
}

.data-box__head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.dense-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.dense-table th {
    background: #f2f6f7;
    color: #405762;
    font-weight: 600;
    font-size: 12px;
    text-align: right;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    white-space: normal;
}

.dense-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    color: #2e3d45;
    vertical-align: middle;
    white-space: normal;
    line-height: 1.55;
}

.dense-table tbody tr:hover td {
    background: #fbfdfe;
}

.dense-table .narrow {
    width: 44px;
}

.dense-table .score-col {
    width: 105px;
}

.dense-table .status-col {
    width: 112px;
}

.dense-table .action-col {
    width: 82px;
}

.row-num {
    color: var(--primary-dark);
    font-weight: 700;
}

.main-cell strong {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.main-cell span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.score-text strong {
    display: block;
    color: var(--primary-dark);
    font-size: 16px;
    font-weight: 700;
}

.score-text span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.score-text em {
    display: inline-flex;
    background: #fff4df;
    color: var(--warning);
    border-radius: 999px;
    padding: 4px 9px;
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
}

.warning-row td {
    background: #fffaf0;
}

.success-row td {
    background: #f4fbf7;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.muted-link {
    color: var(--muted);
}

.approval-bar {
    background: #f7fafb;
    border: 1px dashed #bfd2da;
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.approval-bar p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.approval-bar strong {
    color: var(--primary-dark);
}

.workflow-list {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.workflow-list article {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(22, 50, 65, 0.05);
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 14px;
}

.workflow-list__number {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.workflow-list h3 {
    margin: 0 0 3px;
    font-size: 17px;
    font-weight: 600;
}

.workflow-list p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.detail-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.detail-card h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}

.detail-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.detail-card dl div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.detail-card dt {
    color: var(--muted);
    font-size: 12px;
}

.detail-card dd {
    margin: 0;
    color: var(--text);
    font-weight: 600;
    line-height: 1.7;
}

.empty-inline {
    color: var(--muted);
    margin: 0;
}

@media (max-width: 1050px) {
    .page-titlebar,
    .data-box__head,
    .approval-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .compact-controls form {
        grid-template-columns: 1fr 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .workflow-list article {
        grid-template-columns: 42px 1fr;
    }

    .workflow-list article .btn {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 760px) {
    .compact-controls form {
        grid-template-columns: 1fr;
    }

    .dense-table,
    .dense-table thead,
    .dense-table tbody,
    .dense-table th,
    .dense-table td,
    .dense-table tr {
        display: block;
        width: 100%;
    }

    .dense-table thead {
        display: none;
    }

    .dense-table tr {
        border: 1px solid var(--line);
        border-radius: 14px;
        margin-bottom: 10px;
        overflow: hidden;
    }

    .dense-table td {
        border-bottom: 1px solid var(--line);
    }

    .dense-table td:last-child {
        border-bottom: 0;
    }

    .detail-card dl div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}


/* ===== Data Screen V4: Dense administrative table ===== */

.data-screen-head {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: 0 6px 18px rgba(22, 50, 65, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.data-screen-title span {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.data-screen-title h2 {
    margin: 2px 0 3px;
    font-size: 22px;
    font-weight: 600;
}

.data-screen-title p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.data-screen-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.data-screen-toolbar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 6px 18px rgba(22, 50, 65, 0.04);
    display: grid;
    grid-template-columns: 1fr minmax(430px, 0.85fr);
    gap: 10px;
    align-items: center;
}

.data-screen-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.data-screen-stats a,
.data-screen-stats span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    border: 1px solid var(--line);
    background: #f7fafb;
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 600;
}

.data-screen-stats a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.data-screen-stats strong {
    font-weight: 700;
}

.data-screen-search {
    display: grid;
    grid-template-columns: 150px 1fr auto auto;
    gap: 7px;
    align-items: center;
}

.data-screen-search select,
.data-screen-search input {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 7px 10px;
    font-family: inherit;
    background: #fff;
    font-size: 13px;
}

.data-grid-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--shadow);
}

.data-grid-panel__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.data-grid-panel__head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.data-grid-panel__head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.data-grid-wrap {
    overflow-x: visible;
}

.data-grid-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.data-grid-table th {
    background: #f2f6f7;
    color: #405762;
    font-weight: 600;
    font-size: 12px;
    text-align: right;
    padding: 8px 7px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-grid-table td {
    padding: 7px;
    border-bottom: 1px solid var(--line);
    color: #2e3d45;
    font-size: 13px;
    line-height: 1.45;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-grid-table tbody tr:hover td {
    background: #fbfdfe;
}

.data-grid-table .row-alert td {
    background: #fffaf0;
}

.c-index {
    width: 38px;
}

.c-name {
    width: 16%;
}

.c-id {
    width: 92px;
}

.c-role {
    width: 88px;
}

.c-opportunity {
    width: 18%;
}

.c-sector {
    width: 12%;
}

.c-score {
    width: 82px;
}

.c-badge {
    width: 94px;
}

.c-action {
    width: 54px;
}

.index-cell {
    color: var(--primary-dark);
    font-weight: 700;
}

.name-cell {
    font-weight: 600;
    color: var(--text);
}

.mono-cell {
    font-variant-numeric: tabular-nums;
    color: #405762;
}

.truncate-cell {
    max-width: 100%;
}

.score-compact {
    text-align: center;
}

.score-compact strong {
    display: block;
    color: var(--primary-dark);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
}

.score-compact span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.score-compact em {
    font-style: normal;
    color: var(--warning);
    font-weight: 700;
}

.action-cell {
    text-align: center;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 3px 8px;
    border-radius: 9px;
    background: var(--soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.table-action:hover {
    background: var(--primary);
    color: #fff;
}

.data-pagination {
    margin-top: 12px;
}

@media (max-width: 1200px) {
    .data-screen-toolbar {
        grid-template-columns: 1fr;
    }

    .data-screen-search {
        grid-template-columns: 180px 1fr auto auto;
    }
}

@media (max-width: 860px) {
    .data-screen-head,
    .data-grid-panel__head {
        flex-direction: column;
        align-items: stretch;
    }

    .data-screen-search {
        grid-template-columns: 1fr;
    }

    .data-grid-wrap {
        overflow-x: auto;
    }

    .data-grid-table {
        min-width: 980px;
    }
}


/* ===== V5 Operational Dense Data Screen ===== */

.ops-head {
    min-height: 64px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 8px;
    box-shadow: 0 5px 16px rgba(22, 50, 65, 0.045);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ops-title span {
    display: block;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.ops-title h2 {
    margin: 2px 0 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.ops-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ops-actions .btn,
.ops-search .btn {
    min-height: 34px;
    border-radius: 10px;
    padding: 6px 12px;
}

.ops-toolbar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: 0 5px 16px rgba(22, 50, 65, 0.035);
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 8px;
    align-items: center;
}

.ops-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ops-tabs a,
.ops-tabs span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #f7fafb;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
}

.ops-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.ops-tabs strong {
    font-size: 12px;
    font-weight: 700;
}

.ops-search {
    display: grid;
    grid-template-columns: 1fr 150px auto auto;
    gap: 6px;
    align-items: center;
}

.ops-search input,
.ops-search select {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 13px;
    background: #fff;
}

.ops-table-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    box-shadow: var(--shadow);
}

.ops-table-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.ops-table-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ops-table-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.ops-table-wrap {
    width: 100%;
    overflow: hidden;
}

.ops-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
}

.ops-table th {
    background: #f2f6f7;
    color: #405762;
    font-weight: 600;
    font-size: 11.5px;
    text-align: right;
    padding: 7px 6px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.ops-table td {
    height: 38px;
    padding: 5px 6px;
    border-bottom: 1px solid var(--line);
    color: #2e3d45;
    font-size: 12.5px;
    line-height: 1.25;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-table tbody tr:hover td {
    background: #fbfdfe;
}

.ops-table tbody tr.is-alert td {
    background: #fffaf0;
}

.t-index {
    width: 36px;
}

.t-candidate {
    width: 15%;
}

.t-id {
    width: 92px;
}

.t-role {
    width: 78px;
}

.t-opportunity {
    width: 18%;
}

.t-sector {
    width: 11.5%;
}

.t-score {
    width: 78px;
}

.t-match {
    width: 78px;
}

.t-status {
    width: 96px;
}

.t-action {
    width: 50px;
}

.idx {
    color: var(--primary-dark);
    font-weight: 700;
    text-align: center;
}

.txt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.strong-cell {
    font-weight: 600;
    color: var(--text);
}

.mono {
    font-variant-numeric: tabular-nums;
    color: #405762;
    direction: ltr;
    text-align: right;
}

.score-mini {
    text-align: center;
}

.score-mini strong {
    display: block;
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.score-mini span {
    display: block;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.15;
}

.score-mini em {
    font-style: normal;
    color: var(--warning);
    font-weight: 700;
}

.mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--primary-dark);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.mini-badge--ok {
    background: #eaf7f0;
    color: var(--success);
}

.mini-badge--warn {
    background: #fff4df;
    color: var(--warning);
}

.row-link {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 12px;
}

.row-link:hover {
    text-decoration: underline;
}

.ops-pagination {
    margin-top: 10px;
}

@media (max-width: 1200px) {
    .ops-toolbar {
        grid-template-columns: 1fr;
    }

    .ops-search {
        grid-template-columns: minmax(220px, 1fr) 170px auto auto;
    }

    .ops-table-wrap {
        overflow-x: auto;
    }

    .ops-table {
        min-width: 1120px;
    }
}

@media (max-width: 780px) {
    .ops-head,
    .ops-table-head {
        flex-direction: column;
        align-items: stretch;
    }

    .ops-search {
        grid-template-columns: 1fr;
    }
}


/* ===== V6 Data Workbench: final compact operational table ===== */

/* widen data pages without changing base template */
body:has(.workbench-head) main,
body:has(.workbench-head) .container,
body:has(.workbench-head) .page,
body:has(.workbench-head) .content,
body:has(.workbench-head) .main-content {
    max-width: min(1540px, calc(100% - 32px)) !important;
    width: min(1540px, calc(100% - 32px)) !important;
}

/* compact top header for dense data screens */
.workbench-head {
    min-height: 52px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 9px 12px;
    margin-bottom: 7px;
    box-shadow: 0 4px 14px rgba(22, 50, 65, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.workbench-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.workbench-title strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
}

.workbench-title span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
}

.workbench-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.workbench-actions a,
.workbench-filter button,
.workbench-filter a,
.workbench-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #eef4f6;
    color: var(--primary-dark);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    font-family: inherit;
}

.workbench-actions a:first-child,
.workbench-filter button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* one compact line for stats + filters */
.workbench-bar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 7px;
    margin-bottom: 7px;
    box-shadow: 0 4px 14px rgba(22, 50, 65, 0.035);
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 8px;
    align-items: center;
}

.workbench-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.workbench-tabs a,
.workbench-tabs span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 27px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7fafb;
    color: var(--primary-dark);
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.workbench-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.workbench-tabs b {
    font-size: 11.5px;
    font-weight: 800;
}

.workbench-filter {
    display: grid;
    grid-template-columns: 1fr 150px auto auto;
    gap: 6px;
    align-items: center;
}

.workbench-filter input,
.workbench-filter select {
    min-height: 31px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 12.5px;
}

.workbench-filter input::placeholder {
    color: #8a9aa2;
}

/* table card */
.workbench-table-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
}

.workbench-table-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.workbench-table-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.workbench-table-head span {
    color: var(--muted);
    font-size: 11.5px;
}

.workbench-table-wrap {
    width: 100%;
    overflow: hidden;
}

.workbench-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.workbench-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f7;
    color: #3c535d;
    border-bottom: 1px solid var(--line);
    padding: 6px 5px;
    font-size: 11.2px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.workbench-table tbody td {
    height: 34px;
    padding: 4px 5px;
    border-bottom: 1px solid var(--line);
    color: #2e3d45;
    font-size: 12.2px;
    line-height: 1.2;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workbench-table tbody tr:hover td {
    background: #fbfdfe;
}

.workbench-table tbody tr.row-unmatched td {
    background: #fffaf0;
}

.w-no { width: 34px; }
.w-name { width: 15.5%; }
.w-id { width: 90px; }
.w-role { width: 76px; }
.w-school { width: 18%; }
.w-sector { width: 11.4%; }
.w-grade { width: 74px; }
.w-match { width: 76px; }
.w-state { width: 88px; }
.w-view { width: 46px; }

.num {
    color: var(--primary-dark);
    font-weight: 800;
    text-align: center;
}

.clip {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.strong {
    font-weight: 700;
    color: var(--text);
}

.id {
    font-variant-numeric: tabular-nums;
    direction: ltr;
    text-align: right;
    color: #405762;
}

.grade {
    text-align: center;
}

.grade b {
    display: block;
    color: var(--primary-dark);
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1;
}

.grade b.missing {
    color: var(--warning);
}

.grade small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.1;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.ok {
    background: #eaf7f0;
    color: var(--success);
}

.status-pill.warn {
    background: #fff4df;
    color: var(--warning);
}

.view-link {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

.view-link:hover {
    text-decoration: underline;
}

.workbench-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1250px) {
    .workbench-bar {
        grid-template-columns: 1fr;
    }

    .workbench-filter {
        grid-template-columns: minmax(240px, 1fr) 160px auto auto;
    }

    .workbench-table-wrap {
        overflow-x: auto;
    }

    .workbench-table {
        min-width: 1120px;
    }
}

@media (max-width: 780px) {
    body:has(.workbench-head) main,
    body:has(.workbench-head) .container,
    body:has(.workbench-head) .page,
    body:has(.workbench-head) .content,
    body:has(.workbench-head) .main-content {
        width: calc(100% - 20px) !important;
    }

    .workbench-head,
    .workbench-table-head {
        flex-direction: column;
        align-items: stretch;
    }

    .workbench-filter {
        grid-template-columns: 1fr;
    }
}


/* ===== V7 Review Board: flexible data processing layout ===== */

body:has(.review-board-head) .page {
    width: min(1460px, calc(100% - 36px));
}

.review-board-head {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(22, 50, 65, 0.055);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.review-board-head span {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.review-board-head h2 {
    margin: 3px 0 4px;
    font-size: 24px;
    font-weight: 600;
}

.review-board-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.review-board-head nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.review-board-head nav a,
.review-filter-form button,
.review-filter-form .filter-actions a,
.review-data-head > a,
.review-pagination a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #eef4f6;
    color: var(--primary-dark);
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.review-board-head nav .primary-link,
.review-filter-form button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.review-board-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 14px;
    align-items: start;
}

.review-rail {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 12px;
}

.rail-title h3 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
}

.rail-title p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.rail-item {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 9px 10px;
    margin-bottom: 8px;
    background: #f8fbfc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rail-item span {
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
}

.rail-item strong {
    min-width: 34px;
    min-height: 28px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 13px;
}

.rail-item.active {
    background: var(--primary);
    border-color: var(--primary);
}

.rail-item.active span,
.rail-item.active strong {
    color: #fff;
}

.rail-item.active strong {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.rail-item--ready {
    background: #f4fbf7;
}

.rail-item--warn {
    background: #fffaf0;
}

.rail-note {
    margin-top: 12px;
    border: 1px dashed #bfd2da;
    border-radius: 14px;
    padding: 11px;
    background: #f7fafb;
}

.rail-note strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 4px;
    font-size: 13px;
}

.rail-note p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.review-workspace {
    min-width: 0;
}

.review-filter-card,
.review-data-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.review-filter-form {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 220px auto;
    gap: 10px;
    align-items: end;
}

.review-filter-form label {
    display: grid;
    gap: 5px;
}

.review-filter-form label span {
    color: var(--muted);
    font-size: 12px;
}

.review-filter-form input,
.review-filter-form select {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

.review-mini-stats {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.review-mini-stats span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7fafb;
    padding: 5px 10px;
    color: var(--muted);
    font-size: 12px;
}

.review-mini-stats strong {
    color: var(--primary-dark);
}

.review-data-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.review-data-head h3 {
    margin: 0 0 3px;
    font-size: 18px;
    font-weight: 600;
}

.review-data-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.review-table th {
    background: #f2f6f7;
    color: #405762;
    font-weight: 700;
    font-size: 12px;
    text-align: right;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.review-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    color: #2e3d45;
    white-space: normal;
    line-height: 1.55;
}

.review-table tbody tr:hover td {
    background: #fbfdfe;
}

.review-table tbody tr.needs-review td {
    background: #fffaf0;
}

.col-num {
    width: 44px;
}

.col-person {
    width: 24%;
}

.col-opportunity {
    width: 28%;
}

.col-score {
    width: 100px;
}

.col-quality {
    width: 125px;
}

.col-state {
    width: 125px;
}

.col-process {
    width: 90px;
}

.num-cell {
    font-weight: 800;
    color: var(--primary-dark);
    text-align: center;
}

.person-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
}

.person-cell span,
.opportunity-cell span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.score-cell-board strong {
    display: block;
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

.score-cell-board span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.score-cell-board em {
    display: inline-flex;
    border-radius: 999px;
    background: #fff4df;
    color: var(--warning);
    padding: 4px 9px;
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
}

.state-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    max-width: 100%;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.state-chip--ok {
    background: #eaf7f0;
    color: var(--success);
}

.state-chip--warn {
    background: #fff4df;
    color: var(--warning);
}

.quality-cell small {
    display: block;
    margin-top: 5px;
    color: #8a5a00;
    font-size: 11px;
    line-height: 1.5;
}

.process-cell {
    display: grid;
    gap: 5px;
}

.process-link,
.admin-link {
    font-size: 12px;
    font-weight: 800;
}

.process-link {
    color: var(--primary-dark);
}

.admin-link {
    color: var(--muted);
}

.process-link:hover,
.admin-link:hover {
    text-decoration: underline;
}

.review-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1180px) {
    .review-board-layout {
        grid-template-columns: 1fr;
    }

    .review-rail {
        position: static;
    }

    .review-rail {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .rail-title,
    .rail-note {
        grid-column: 1 / -1;
    }

    .rail-item {
        margin-bottom: 0;
    }
}

@media (max-width: 900px) {
    body:has(.review-board-head) .page {
        width: calc(100% - 20px);
    }

    .review-board-head,
    .review-data-head {
        flex-direction: column;
        align-items: stretch;
    }

    .review-filter-form {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-wrap: wrap;
    }

    .review-table {
        min-width: 900px;
    }

    .review-data-card {
        overflow-x: auto;
    }

    .review-rail {
        grid-template-columns: 1fr;
    }
}


/* ===== V8 Processing Workflow Enhancements ===== */

.grouped-rail .rail-group {
    margin-bottom: 14px;
}

.grouped-rail .rail-group h4 {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.bulk-action-bar {
    background: #f7fafb;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.bulk-action-bar strong {
    display: block;
    color: var(--primary-dark);
    font-size: 14px;
    margin-bottom: 2px;
}

.bulk-action-bar span {
    color: var(--muted);
    font-size: 12px;
}

.bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bulk-controls select {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 12.5px;
    min-width: 210px;
}

.bulk-controls button {
    min-height: 36px;
    border: 1px solid var(--primary);
    border-radius: 11px;
    background: var(--primary);
    color: #fff;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.process-table .col-check {
    width: 42px;
}

.process-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.application-process-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 14px;
    align-items: start;
}

.application-detail-main {
    min-width: 0;
}

.detail-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 14px;
    box-shadow: 0 8px 22px rgba(22, 50, 65, 0.045);
}

.detail-summary-strip span {
    background: #f7fafb;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 11px;
    color: var(--muted);
    font-size: 12px;
}

.detail-summary-strip strong {
    color: var(--primary-dark);
}

.application-process-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 12px;
}

.application-process-panel h3 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 600;
}

.application-process-panel p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 13px;
}

.application-process-panel label {
    display: grid;
    gap: 6px;
}

.application-process-panel label span {
    color: var(--muted);
    font-size: 12px;
}

.application-process-panel textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    font-family: inherit;
    resize: vertical;
    min-height: 110px;
}

.process-buttons {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.process-buttons button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f7fafb;
    color: var(--primary-dark);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.process-buttons button:first-child {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.process-buttons button:nth-child(3),
.process-buttons button:nth-child(4) {
    background: #fffaf0;
    color: var(--warning);
    border-color: #f2dcaa;
}

@media (max-width: 1050px) {
    .bulk-action-bar,
    .bulk-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .application-process-layout {
        grid-template-columns: 1fr;
    }

    .application-process-panel {
        position: static;
    }
}


/* ===== V9 Contextual Processing Tables ===== */

.contextual-filter {
    padding-bottom: 12px;
}

.context-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.context-actions a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #eef4f6;
    color: var(--primary-dark);
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 700;
}

.context-actions span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.bulk-action-bar {
    opacity: 0.72;
    transition: 0.18s ease;
}

.bulk-action-bar.is-active {
    opacity: 1;
    border-color: rgba(47, 113, 136, 0.35);
    box-shadow: 0 10px 26px rgba(22, 50, 65, 0.06);
}

.context-table th,
.context-table td {
    white-space: normal;
}

.context-table .person-cell,
.context-table .opportunity-cell {
    min-width: 0;
}

.context-table td {
    line-height: 1.65;
}

.context-table .state-chip {
    white-space: normal;
    text-align: center;
}

@media (max-width: 900px) {
    .context-actions {
        align-items: stretch;
        flex-direction: column;
    }
}


/* ===== V10 Simplified Processing Interface ===== */

.v10-head {
    padding-top: 14px;
    padding-bottom: 14px;
}

.v10-layout {
    grid-template-columns: 252px 1fr;
}

.v10-rail {
    padding: 12px;
}

.v10-rail .rail-title h3 {
    font-size: 16px;
}

.v10-rail .rail-title p {
    margin-bottom: 10px;
}

.v10-rail .rail-group {
    margin-bottom: 10px;
}

.v10-rail .rail-group h4 {
    margin-bottom: 5px;
}

.v10-rail .rail-item {
    min-height: 38px;
    padding: 7px 9px;
    margin-bottom: 6px;
    border-radius: 12px;
}

.v10-rail .rail-item span {
    font-size: 12.5px;
}

.v10-rail .rail-item strong {
    min-width: 30px;
    min-height: 24px;
    font-size: 12px;
    background: #fff;
}

.v10-filter {
    padding: 12px;
}

.bulk-hint {
    border: 1px dashed #bfd2da;
    background: #f7fafb;
    color: var(--muted);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 12.5px;
}

.bulk-hint.is-hidden {
    display: none;
}

.v10-bulk {
    display: none;
    margin-bottom: 12px;
}

.v10-bulk.is-active {
    display: flex;
}

.v10-data-card {
    padding: 13px;
}

.v10-table-head {
    margin-bottom: 10px;
}

.v10-table-head h3 {
    font-size: 17px;
}

.v10-table th {
    padding-top: 9px;
    padding-bottom: 9px;
}

.v10-table td {
    padding-top: 9px;
    padding-bottom: 9px;
}

.v10-table .col-process {
    width: 76px;
}

.v10-table .process-cell {
    display: block;
}

.v10-table .process-link {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
}

.v10-table .opportunity-cell span {
    line-height: 1.55;
}

.v10-table.context-table td {
    line-height: 1.6;
}

@media (max-width: 1180px) {
    .v10-layout {
        grid-template-columns: 1fr;
    }

    .v10-bulk.is-active {
        flex-direction: column;
        align-items: stretch;
    }
}


/* ===== V11 Calm Review Interface: lighter typography + less visual crowding ===== */

body:has(.calm-page) {
    font-weight: 400;
}

body:has(.calm-page) strong,
body:has(.calm-page) b,
body:has(.calm-page) h1,
body:has(.calm-page) h2,
body:has(.calm-page) h3,
body:has(.calm-page) h4 {
    font-weight: 500;
}

/* reduce global header impact only on this page */
body:has(.calm-page) header {
    min-height: auto;
}

body:has(.calm-page) .page,
body:has(.calm-page) .container,
body:has(.calm-page) main {
    max-width: min(1480px, calc(100% - 44px));
}

.calm-page {
    --calm-border: #dde7eb;
    --calm-soft: #f7fafb;
    --calm-text: #243740;
    --calm-muted: #788990;
    --calm-primary: var(--primary);
    --calm-shadow: 0 8px 22px rgba(22, 50, 65, 0.045);
}

.calm-head {
    background: #fff;
    border: 1px solid var(--calm-border);
    border-radius: 18px;
    padding: 15px 18px;
    margin-bottom: 12px;
    box-shadow: var(--calm-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.calm-title span {
    display: block;
    color: var(--calm-primary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 3px;
}

.calm-title h2 {
    margin: 0 0 4px;
    color: var(--calm-text);
    font-size: 23px;
    line-height: 1.35;
}

.calm-title p {
    margin: 0;
    color: var(--calm-muted);
    font-size: 13px;
    line-height: 1.7;
}

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

.calm-actions a,
.calm-filter-form button,
.calm-filter-form a,
.calm-export,
.calm-bulk-controls button {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--calm-border);
    border-radius: 11px;
    background: #f1f6f7;
    color: var(--primary-dark);
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.calm-actions .is-primary,
.calm-filter-form button,
.calm-bulk-controls button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.calm-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 13px;
    align-items: start;
}

.calm-rail {
    background: #fff;
    border: 1px solid var(--calm-border);
    border-radius: 18px;
    padding: 12px;
    box-shadow: var(--calm-shadow);
    position: sticky;
    top: 12px;
}

.calm-rail-title h3 {
    margin: 0 0 3px;
    color: var(--calm-text);
    font-size: 16px;
}

.calm-rail-title p {
    margin: 0 0 10px;
    color: var(--calm-muted);
    font-size: 12px;
    line-height: 1.6;
}

.calm-rail-group {
    margin-bottom: 11px;
}

.calm-rail-group h4 {
    margin: 0 0 6px;
    color: var(--calm-muted);
    font-size: 11.5px;
    font-weight: 500;
}

.calm-rail-item {
    min-height: 36px;
    border: 1px solid var(--calm-border);
    border-radius: 12px;
    padding: 6px 8px;
    margin-bottom: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}

.calm-rail-item span {
    color: var(--primary-dark);
    font-size: 12.5px;
    font-weight: 500;
}

.calm-rail-item b {
    min-width: 28px;
    min-height: 23px;
    border-radius: 999px;
    background: var(--calm-soft);
    border: 1px solid var(--calm-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 500;
}

.calm-rail-item.is-warning {
    background: #fffdf8;
}

.calm-rail-item.is-ready {
    background: #f7fcf9;
}

.calm-rail-item.active {
    background: var(--primary);
    border-color: var(--primary);
}

.calm-rail-item.active span,
.calm-rail-item.active b {
    color: #fff;
}

.calm-rail-item.active b {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}

.calm-workspace {
    min-width: 0;
}

.calm-tools {
    background: #fff;
    border: 1px solid var(--calm-border);
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--calm-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.calm-filter-form {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 220px auto auto;
    gap: 8px;
    align-items: center;
}

.calm-filter-form input,
.calm-filter-form select,
.calm-bulk-controls select {
    min-height: 36px;
    border: 1px solid var(--calm-border);
    border-radius: 11px;
    background: #fff;
    color: var(--calm-text);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 400;
}

.calm-filter-form input::placeholder {
    color: #97a6ab;
}

.calm-card {
    background: #fff;
    border: 1px solid var(--calm-border);
    border-radius: 18px;
    padding: 13px;
    box-shadow: var(--calm-shadow);
}

.calm-bulk {
    display: none;
    background: #f7fafb;
    border: 1px solid var(--calm-border);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.calm-bulk.is-active {
    display: flex;
}

.calm-bulk strong {
    display: block;
    color: var(--primary-dark);
    font-size: 13.5px;
    margin-bottom: 2px;
}

.calm-bulk span {
    color: var(--calm-muted);
    font-size: 12px;
}

.calm-bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.calm-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.calm-table-head h3 {
    margin: 0 0 3px;
    color: var(--calm-text);
    font-size: 17px;
}

.calm-table-head p {
    margin: 0;
    color: var(--calm-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.calm-count {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--calm-border);
    border-radius: 999px;
    padding: 4px 10px;
    color: var(--calm-muted);
    background: var(--calm-soft);
    font-size: 12px;
}

.calm-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calm-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--calm-border);
    padding: 9px 10px;
    text-align: right;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.calm-table td {
    padding: 10px;
    border-bottom: 1px solid var(--calm-border);
    color: var(--calm-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    vertical-align: middle;
}

.calm-table tbody tr:hover td {
    background: #fbfdfe;
}

.calm-table tbody tr.needs-review td {
    background: #fffdf7;
}

.calm-table .col-check {
    width: 42px;
}

.calm-table .col-num {
    width: 46px;
}

.calm-table .col-score {
    width: 100px;
}

.calm-table .col-quality,
.calm-table .col-state {
    width: 118px;
}

.calm-table .col-process {
    width: 76px;
}

.calm-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.person-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--calm-text);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
}

.person-cell span,
.opportunity-cell span {
    display: block;
    color: var(--calm-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
}

.score-cell-calm strong {
    display: block;
    color: var(--primary-dark);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.1;
}

.score-cell-calm span {
    display: block;
    color: var(--calm-muted);
    font-size: 12px;
}

.score-cell-calm em {
    display: inline-flex;
    border-radius: 999px;
    background: #fff6e7;
    color: var(--warning);
    padding: 4px 8px;
    font-style: normal;
    font-size: 12px;
    font-weight: 500;
}

.calm-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    max-width: 100%;
    padding: 3px 9px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.calm-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.calm-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.calm-link {
    color: var(--primary-dark);
    font-size: 12.5px;
    font-weight: 500;
}

.calm-link:hover {
    text-decoration: underline;
}

@media (max-width: 1180px) {
    .calm-layout {
        grid-template-columns: 1fr;
    }

    .calm-rail {
        position: static;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .calm-rail-title {
        grid-column: 1 / -1;
    }

    .calm-rail-group {
        margin-bottom: 0;
    }

    .calm-tools,
    .calm-bulk,
    .calm-table-head,
    .calm-head {
        flex-direction: column;
        align-items: stretch;
    }

    .calm-filter-form {
        grid-template-columns: 1fr 200px auto auto;
    }
}

@media (max-width: 860px) {
    body:has(.calm-page) .page,
    body:has(.calm-page) .container,
    body:has(.calm-page) main {
        max-width: calc(100% - 22px);
    }

    .calm-rail,
    .calm-filter-form,
    .calm-bulk-controls {
        grid-template-columns: 1fr;
    }

    .calm-card {
        overflow-x: auto;
    }

    .calm-table {
        min-width: 860px;
    }
}


/* ===== V12 Horizontal Routes + Wide Table ===== */

body:has(.v12-page) {
    font-weight: 400;
}

body:has(.v12-page) strong,
body:has(.v12-page) b,
body:has(.v12-page) h1,
body:has(.v12-page) h2,
body:has(.v12-page) h3,
body:has(.v12-page) h4 {
    font-weight: 500;
}

body:has(.v12-page) .page,
body:has(.v12-page) .container,
body:has(.v12-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v12-page {
    --v12-border: #dde7eb;
    --v12-soft: #f7fafb;
    --v12-text: #253842;
    --v12-muted: #788990;
    --v12-shadow: 0 8px 22px rgba(22, 50, 65, 0.045);
}

.v12-head {
    background: #fff;
    border: 1px solid var(--v12-border);
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 10px;
    box-shadow: var(--v12-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.v12-title span {
    display: block;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 3px;
}

.v12-title h2 {
    margin: 0 0 3px;
    color: var(--v12-text);
    font-size: 23px;
    line-height: 1.35;
}

.v12-title p {
    margin: 0;
    color: var(--v12-muted);
    font-size: 13px;
    line-height: 1.7;
}

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

.v12-actions a,
.v12-filter-form button,
.v12-filter-form a,
.v12-export,
.v12-bulk-controls button {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v12-border);
    border-radius: 11px;
    background: #f1f6f7;
    color: var(--primary-dark);
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.v12-actions .is-primary,
.v12-filter-form button,
.v12-bulk-controls button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* horizontal processing routes */
.v12-routes {
    background: #fff;
    border: 1px solid var(--v12-border);
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: var(--v12-shadow);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.v12-route-group {
    min-width: 0;
    border-inline-start: 1px solid var(--v12-border);
    padding-inline-start: 12px;
}

.v12-route-group:last-child {
    border-inline-start: 0;
    padding-inline-start: 0;
}

.v12-route-group h3 {
    margin: 0 0 8px;
    color: var(--v12-muted);
    font-size: 12px;
    line-height: 1.2;
}

.v12-route-group > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.v12-route {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--v12-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 5px 10px;
    font-size: 12.3px;
    font-weight: 500;
}

.v12-route.is-warning {
    background: #fffdf8;
}

.v12-route.is-ready {
    background: #f7fcf9;
}

.v12-route b {
    min-width: 26px;
    min-height: 22px;
    border-radius: 999px;
    background: var(--v12-soft);
    border: 1px solid var(--v12-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
}

.v12-route.active {
    border-color: rgba(47, 113, 136, 0.45);
    background: #f0f7f9;
    box-shadow: inset 0 -2px 0 var(--primary);
}

.v12-route.active b {
    background: #fff;
    border-color: rgba(47, 113, 136, 0.25);
}

.v12-tools {
    background: #fff;
    border: 1px solid var(--v12-border);
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: var(--v12-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.v12-filter-form {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 220px auto auto;
    gap: 8px;
    align-items: center;
}

.v12-filter-form input,
.v12-filter-form select,
.v12-bulk-controls select {
    min-height: 36px;
    border: 1px solid var(--v12-border);
    border-radius: 11px;
    background: #fff;
    color: var(--v12-text);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 400;
}

.v12-card {
    background: #fff;
    border: 1px solid var(--v12-border);
    border-radius: 18px;
    padding: 13px;
    box-shadow: var(--v12-shadow);
}

.v12-bulk {
    display: none;
    background: #f7fafb;
    border: 1px solid var(--v12-border);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v12-bulk.is-active {
    display: flex;
}

.v12-bulk strong {
    display: block;
    color: var(--primary-dark);
    font-size: 13.5px;
    margin-bottom: 2px;
}

.v12-bulk span {
    color: var(--v12-muted);
    font-size: 12px;
}

.v12-bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.v12-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.v12-table-head h3 {
    margin: 0 0 3px;
    color: var(--v12-text);
    font-size: 17px;
}

.v12-table-head p {
    margin: 0;
    color: var(--v12-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.v12-count {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--v12-border);
    border-radius: 999px;
    padding: 4px 10px;
    color: var(--v12-muted);
    background: var(--v12-soft);
    font-size: 12px;
}

.v12-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v12-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v12-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v12-border);
    padding: 9px 10px;
    text-align: right;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.v12-table td {
    padding: 10px;
    border-bottom: 1px solid var(--v12-border);
    color: var(--v12-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    vertical-align: middle;
}

.v12-table tbody tr:hover td {
    background: #fbfdfe;
}

.v12-table tbody tr.needs-review td {
    background: #fffdf7;
}

.v12-table .col-check {
    width: 42px;
}

.v12-table .col-num {
    width: 46px;
}

.v12-table .col-score {
    width: 100px;
}

.v12-table .col-quality,
.v12-table .col-state {
    width: 118px;
}

.v12-table .col-process {
    width: 76px;
}

.v12-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.person-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v12-text);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
}

.person-cell span,
.opportunity-cell span {
    display: block;
    color: var(--v12-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
}

.score-cell-v12 strong {
    display: block;
    color: var(--primary-dark);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.1;
}

.score-cell-v12 span {
    display: block;
    color: var(--v12-muted);
    font-size: 12px;
}

.score-cell-v12 em {
    display: inline-flex;
    border-radius: 999px;
    background: #fff6e7;
    color: var(--warning);
    padding: 4px 8px;
    font-style: normal;
    font-size: 12px;
    font-weight: 500;
}

.v12-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    max-width: 100%;
    padding: 3px 9px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.v12-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v12-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v12-link {
    color: var(--primary-dark);
    font-size: 12.5px;
    font-weight: 500;
}

.v12-link:hover {
    text-decoration: underline;
}

@media (max-width: 1180px) {
    .v12-routes {
        grid-template-columns: 1fr;
    }

    .v12-route-group,
    .v12-route-group:last-child {
        border-inline-start: 0;
        padding-inline-start: 0;
        border-bottom: 1px solid var(--v12-border);
        padding-bottom: 10px;
    }

    .v12-route-group:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .v12-tools,
    .v12-bulk,
    .v12-table-head,
    .v12-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v12-filter-form {
        grid-template-columns: 1fr 200px auto auto;
    }
}

@media (max-width: 860px) {
    body:has(.v12-page) .page,
    body:has(.v12-page) .container,
    body:has(.v12-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v12-filter-form,
    .v12-bulk-controls {
        grid-template-columns: 1fr;
    }

    .v12-card {
        overflow-x: auto;
    }

    .v12-table {
        min-width: 860px;
    }
}


/* ===== V13 Refined Horizontal Workflow: fewer boxes, calmer hierarchy ===== */

body:has(.v13-page) {
    font-weight: 400;
}

body:has(.v13-page) strong,
body:has(.v13-page) b,
body:has(.v13-page) h1,
body:has(.v13-page) h2,
body:has(.v13-page) h3,
body:has(.v13-page) h4 {
    font-weight: 500;
}

body:has(.v13-page) .page,
body:has(.v13-page) .container,
body:has(.v13-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v13-page {
    --v13-border: #dde7eb;
    --v13-soft: #f7fafb;
    --v13-text: #253842;
    --v13-muted: #7a8a91;
    --v13-shadow: 0 7px 18px rgba(22, 50, 65, 0.04);
}

/* lighter page header */
.v13-head {
    background: #fff;
    border: 1px solid var(--v13-border);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: var(--v13-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.v13-title span {
    display: block;
    color: var(--primary);
    font-size: 11.5px;
    margin-bottom: 2px;
}

.v13-title h2 {
    margin: 0 0 2px;
    color: var(--v13-text);
    font-size: 21px;
    line-height: 1.35;
}

.v13-title p {
    margin: 0;
    color: var(--v13-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.v13-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.v13-actions a,
.v13-filter button,
.v13-filter a,
.v13-bulk-controls button {
    min-height: 33px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v13-border);
    border-radius: 10px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 6px 11px;
    font-family: inherit;
    font-size: 12.2px;
    font-weight: 500;
    white-space: nowrap;
}

.v13-actions .is-primary,
.v13-filter button,
.v13-bulk-controls button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* combined workbar: routes + filters, less boxed */
.v13-workbar {
    background: #fff;
    border: 1px solid var(--v13-border);
    border-radius: 16px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: var(--v13-shadow);
    display: grid;
    gap: 9px;
}

.v13-routes {
    display: grid;
    gap: 6px;
}

.v13-route-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v13-route-label {
    min-width: 92px;
    color: var(--v13-muted);
    font-size: 12px;
}

.v13-route {
    min-height: 29px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--v13-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 500;
}

.v13-route.is-warning {
    background: #fffdf8;
}

.v13-route.is-ready {
    background: #f7fcf9;
}

.v13-route b {
    min-width: 24px;
    min-height: 20px;
    border-radius: 999px;
    background: var(--v13-soft);
    border: 1px solid var(--v13-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.v13-route.active {
    border-color: rgba(47, 113, 136, 0.45);
    background: #f0f7f9;
    box-shadow: inset 0 -2px 0 var(--primary);
}

.v13-filter {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 220px auto auto auto;
    gap: 7px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--v13-border);
}

.v13-filter input,
.v13-filter select,
.v13-bulk-controls select {
    min-height: 34px;
    border: 1px solid var(--v13-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v13-text);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12.4px;
    font-weight: 400;
}

/* table card */
.v13-card {
    background: #fff;
    border: 1px solid var(--v13-border);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--v13-shadow);
}

.v13-bulk {
    display: none;
    background: #f7fafb;
    border: 1px solid var(--v13-border);
    border-radius: 13px;
    padding: 9px 11px;
    margin-bottom: 10px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v13-bulk.is-active {
    display: flex;
}

.v13-bulk strong {
    display: block;
    color: var(--primary-dark);
    font-size: 13px;
    margin-bottom: 2px;
}

.v13-bulk span {
    color: var(--v13-muted);
    font-size: 12px;
}

.v13-bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.v13-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.v13-table-head h3 {
    margin: 0 0 2px;
    color: var(--v13-text);
    font-size: 16px;
}

.v13-table-head p {
    margin: 0;
    color: var(--v13-muted);
    font-size: 12px;
    line-height: 1.55;
}

.v13-count {
    color: var(--v13-muted);
    font-size: 12px;
    white-space: nowrap;
}

.v13-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v13-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v13-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v13-border);
    padding: 8px 9px;
    text-align: right;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v13-table td {
    padding: 9px;
    border-bottom: 1px solid var(--v13-border);
    color: var(--v13-text);
    font-size: 12.8px;
    font-weight: 400;
    line-height: 1.48;
    vertical-align: middle;
}

.v13-table tbody tr:hover td {
    background: #fbfdfe;
}

.v13-table tbody tr.needs-review td {
    background: #fffefa;
}

.v13-table .col-check {
    width: 42px;
}

.v13-table .col-num {
    width: 46px;
}

.v13-table .col-score {
    width: 96px;
}

.v13-table .col-quality,
.v13-table .col-state {
    width: 112px;
}

.v13-table .col-process {
    width: 70px;
}

.v13-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.person-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v13-text);
    font-size: 13.2px;
    font-weight: 500;
    margin-bottom: 2px;
}

.person-cell span,
.opportunity-cell span {
    display: block;
    color: var(--v13-muted);
    font-size: 11.8px;
    font-weight: 400;
    line-height: 1.5;
}

.score-cell-v13 strong {
    display: block;
    color: var(--primary-dark);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.1;
}

.score-cell-v13 span {
    display: block;
    color: var(--v13-muted);
    font-size: 11.5px;
}

.score-cell-v13 em {
    display: inline-flex;
    border-radius: 999px;
    background: #fff6e7;
    color: var(--warning);
    padding: 3px 8px;
    font-style: normal;
    font-size: 11.8px;
    font-weight: 500;
}

.v13-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v13-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v13-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v13-link {
    color: var(--primary-dark);
    font-size: 12.2px;
    font-weight: 500;
}

.v13-link:hover {
    text-decoration: underline;
}

@media (max-width: 1180px) {
    .v13-head,
    .v13-table-head,
    .v13-bulk {
        flex-direction: column;
        align-items: stretch;
    }

    .v13-filter {
        grid-template-columns: 1fr 200px auto auto auto;
    }
}

@media (max-width: 860px) {
    body:has(.v13-page) .page,
    body:has(.v13-page) .container,
    body:has(.v13-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v13-filter,
    .v13-bulk-controls {
        grid-template-columns: 1fr;
    }

    .v13-card {
        overflow-x: auto;
    }

    .v13-table {
        min-width: 860px;
    }
}


/* ===== V14 Unified Workbar + Wide Context Table ===== */

body:has(.v14-page) {
    font-weight: 400;
}

body:has(.v14-page) strong,
body:has(.v14-page) b,
body:has(.v14-page) h1,
body:has(.v14-page) h2,
body:has(.v14-page) h3,
body:has(.v14-page) h4 {
    font-weight: 500;
}

body:has(.v14-page) .page,
body:has(.v14-page) .container,
body:has(.v14-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v14-page {
    --v14-border: #dce7eb;
    --v14-soft: #f7fafb;
    --v14-text: #253842;
    --v14-muted: #7c8b92;
    --v14-shadow: 0 7px 18px rgba(22, 50, 65, 0.04);
}

.v14-head {
    background: #fff;
    border: 1px solid var(--v14-border);
    border-radius: 15px;
    padding: 11px 15px;
    margin-bottom: 8px;
    box-shadow: var(--v14-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.v14-title span {
    display: block;
    color: var(--primary);
    font-size: 11.5px;
    margin-bottom: 2px;
}

.v14-title h2 {
    margin: 0;
    color: var(--v14-text);
    font-size: 20px;
    line-height: 1.35;
}

.v14-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.v14-actions a,
.v14-filter button,
.v14-filter a,
.v14-bulk-controls button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v14-border);
    border-radius: 10px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12.1px;
    font-weight: 500;
    white-space: nowrap;
}

.v14-actions .is-primary,
.v14-filter button,
.v14-bulk-controls button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* one unified workbar */
.v14-command {
    background: #fff;
    border: 1px solid var(--v14-border);
    border-radius: 15px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: var(--v14-shadow);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(520px, 0.72fr);
    gap: 10px;
    align-items: center;
}

.v14-routes {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v14-label {
    color: var(--v14-muted);
    font-size: 11.8px;
    margin-inline-end: 2px;
}

.v14-divider {
    width: 1px;
    height: 22px;
    background: var(--v14-border);
    margin-inline: 4px;
}

.v14-route {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--v14-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 8px;
    font-size: 11.8px;
    font-weight: 500;
}

.v14-route.is-warning {
    background: #fffdf8;
}

.v14-route.is-ready {
    background: #f7fcf9;
}

.v14-route b {
    min-width: 23px;
    min-height: 19px;
    border-radius: 999px;
    background: var(--v14-soft);
    border: 1px solid var(--v14-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10.8px;
}

.v14-route.active {
    border-color: rgba(47, 113, 136, 0.45);
    background: #f0f7f9;
    box-shadow: inset 0 -2px 0 var(--primary);
}

.v14-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 200px auto auto auto;
    gap: 7px;
    align-items: center;
}

.v14-filter input,
.v14-filter select,
.v14-bulk-controls select {
    min-height: 32px;
    border: 1px solid var(--v14-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v14-text);
    padding: 6px 9px;
    font-family: inherit;
    font-size: 12.2px;
    font-weight: 400;
}

/* table card */
.v14-card {
    background: #fff;
    border: 1px solid var(--v14-border);
    border-radius: 15px;
    padding: 11px;
    box-shadow: var(--v14-shadow);
}

.v14-bulk {
    display: none;
    background: #f7fafb;
    border: 1px solid var(--v14-border);
    border-radius: 13px;
    padding: 9px 11px;
    margin-bottom: 10px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v14-bulk.is-active {
    display: flex;
}

.v14-bulk strong {
    display: block;
    color: var(--primary-dark);
    font-size: 13px;
    margin-bottom: 2px;
}

.v14-bulk span {
    color: var(--v14-muted);
    font-size: 12px;
}

.v14-bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.v14-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.v14-table-head h3 {
    margin: 0;
    color: var(--v14-text);
    font-size: 16px;
}

.v14-count {
    color: var(--v14-muted);
    font-size: 12px;
    white-space: nowrap;
}

.v14-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v14-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v14-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v14-border);
    padding: 8px 9px;
    text-align: right;
    font-size: 11.7px;
    font-weight: 500;
    white-space: nowrap;
}

.v14-table td {
    padding: 9px;
    border-bottom: 1px solid var(--v14-border);
    color: var(--v14-text);
    font-size: 12.8px;
    font-weight: 400;
    line-height: 1.48;
    vertical-align: middle;
}

.v14-table tbody tr:hover td {
    background: #fbfdfe;
}

.v14-table tbody tr.needs-review td {
    background: #fffefa;
}

.v14-table .col-check {
    width: 42px;
}

.v14-table .col-num {
    width: 46px;
}

.v14-table .col-score {
    width: 96px;
}

.v14-table .col-quality,
.v14-table .col-state {
    width: 112px;
}

.v14-table .col-process {
    width: 64px;
}

.v14-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.person-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v14-text);
    font-size: 13.2px;
    font-weight: 500;
    margin-bottom: 2px;
}

.person-cell span,
.opportunity-cell span {
    display: block;
    color: var(--v14-muted);
    font-size: 11.8px;
    font-weight: 400;
    line-height: 1.5;
}

.score-cell-v14 strong {
    display: block;
    color: var(--primary-dark);
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.1;
}

.score-cell-v14 span {
    display: block;
    color: var(--v14-muted);
    font-size: 11.5px;
}

.score-cell-v14 em {
    display: inline-flex;
    border-radius: 999px;
    background: #fff6e7;
    color: var(--warning);
    padding: 3px 8px;
    font-style: normal;
    font-size: 11.8px;
    font-weight: 500;
}

.v14-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v14-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v14-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v14-link {
    color: var(--primary-dark);
    font-size: 12.2px;
    font-weight: 500;
}

.v14-link:hover {
    text-decoration: underline;
}

@media (max-width: 1280px) {
    .v14-command {
        grid-template-columns: 1fr;
    }

    .v14-filter {
        grid-template-columns: minmax(260px, 1fr) 200px auto auto auto;
    }
}

@media (max-width: 860px) {
    body:has(.v14-page) .page,
    body:has(.v14-page) .container,
    body:has(.v14-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v14-head,
    .v14-table-head,
    .v14-bulk {
        flex-direction: column;
        align-items: stretch;
    }

    .v14-divider {
        display: none;
    }

    .v14-filter,
    .v14-bulk-controls {
        grid-template-columns: 1fr;
    }

    .v14-card {
        overflow-x: auto;
    }

    .v14-table {
        min-width: 860px;
    }
}


/* ===== V15 Main Tabs + Context Filters ===== */

body:has(.v15-page) {
    font-weight: 400;
}

body:has(.v15-page) strong,
body:has(.v15-page) b,
body:has(.v15-page) h1,
body:has(.v15-page) h2,
body:has(.v15-page) h3,
body:has(.v15-page) h4 {
    font-weight: 500;
}

body:has(.v15-page) .page,
body:has(.v15-page) .container,
body:has(.v15-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v15-page {
    --v15-border: #dce7eb;
    --v15-soft: #f7fafb;
    --v15-text: #253842;
    --v15-muted: #7c8b92;
    --v15-shadow: 0 7px 18px rgba(22, 50, 65, 0.04);
}

.v15-head {
    background: #fff;
    border: 1px solid var(--v15-border);
    border-radius: 15px;
    padding: 11px 15px;
    margin-bottom: 8px;
    box-shadow: var(--v15-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.v15-title span {
    display: block;
    color: var(--primary);
    font-size: 11.5px;
    margin-bottom: 2px;
}

.v15-title h2 {
    margin: 0;
    color: var(--v15-text);
    font-size: 20px;
    line-height: 1.35;
}

.v15-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.v15-actions a,
.v15-filter button,
.v15-filter a,
.v15-bulk-controls button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v15-border);
    border-radius: 10px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12.1px;
    font-weight: 500;
    white-space: nowrap;
}

.v15-actions .is-primary,
.v15-filter button,
.v15-bulk-controls button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v15-workspace {
    background: #fff;
    border: 1px solid var(--v15-border);
    border-radius: 15px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: var(--v15-shadow);
    display: grid;
    gap: 8px;
}

.v15-main-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v15-main-tabs a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--v15-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 5px 11px;
    font-size: 12.3px;
    font-weight: 500;
}

.v15-main-tabs a.active {
    background: #f0f7f9;
    border-color: rgba(47, 113, 136, 0.45);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.v15-main-tabs b {
    min-width: 26px;
    min-height: 21px;
    border-radius: 999px;
    background: var(--v15-soft);
    border: 1px solid var(--v15-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 11px;
}

.v15-subroutes {
    min-height: 31px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 7px;
    border-top: 1px solid var(--v15-border);
}

.v15-subroutes a {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--v15-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 9px;
    font-size: 11.8px;
    font-weight: 500;
}

.v15-subroutes a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v15-subroutes a.active b {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.14);
}

.v15-subroutes b {
    min-width: 23px;
    min-height: 19px;
    border-radius: 999px;
    background: var(--v15-soft);
    border: 1px solid var(--v15-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10.8px;
}

.v15-subroutes span {
    color: var(--v15-muted);
    font-size: 12px;
}

.v15-filter {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 210px auto auto auto;
    gap: 7px;
    align-items: center;
    padding-top: 7px;
    border-top: 1px solid var(--v15-border);
}

.v15-filter input,
.v15-filter select,
.v15-bulk-controls select {
    min-height: 32px;
    border: 1px solid var(--v15-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v15-text);
    padding: 6px 9px;
    font-family: inherit;
    font-size: 12.2px;
    font-weight: 400;
}

.v15-card {
    background: #fff;
    border: 1px solid var(--v15-border);
    border-radius: 15px;
    padding: 11px;
    box-shadow: var(--v15-shadow);
}

.v15-bulk {
    display: none;
    background: #f7fafb;
    border: 1px solid var(--v15-border);
    border-radius: 13px;
    padding: 9px 11px;
    margin-bottom: 10px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v15-bulk.is-active {
    display: flex;
}

.v15-bulk strong {
    display: block;
    color: var(--primary-dark);
    font-size: 13px;
    margin-bottom: 2px;
}

.v15-bulk span {
    color: var(--v15-muted);
    font-size: 12px;
}

.v15-bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.v15-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.v15-table-head h3 {
    margin: 0;
    color: var(--v15-text);
    font-size: 16px;
}

.v15-table-head span {
    color: var(--v15-muted);
    font-size: 12px;
    white-space: nowrap;
}

.v15-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v15-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v15-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v15-border);
    padding: 8px 9px;
    text-align: right;
    font-size: 11.7px;
    font-weight: 500;
    white-space: nowrap;
}

.v15-table td {
    padding: 9px;
    border-bottom: 1px solid var(--v15-border);
    color: var(--v15-text);
    font-size: 12.8px;
    font-weight: 400;
    line-height: 1.48;
    vertical-align: middle;
}

.v15-table tbody tr:hover td {
    background: #fbfdfe;
}

.v15-table tbody tr.needs-review td {
    background: #fffefa;
}

.v15-table .col-check {
    width: 42px;
}

.v15-table .col-num {
    width: 46px;
}

.v15-table .col-score {
    width: 96px;
}

.v15-table .col-quality,
.v15-table .col-state {
    width: 112px;
}

.v15-table .col-process {
    width: 64px;
}

.v15-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.person-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v15-text);
    font-size: 13.2px;
    font-weight: 500;
    margin-bottom: 2px;
}

.person-cell span,
.opportunity-cell span {
    display: block;
    color: var(--v15-muted);
    font-size: 11.8px;
    font-weight: 400;
    line-height: 1.5;
}

.score-cell-v15 strong {
    display: block;
    color: var(--primary-dark);
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.1;
}

.score-cell-v15 span {
    display: block;
    color: var(--v15-muted);
    font-size: 11.5px;
}

.score-cell-v15 em {
    display: inline-flex;
    border-radius: 999px;
    background: #fff6e7;
    color: var(--warning);
    padding: 3px 8px;
    font-style: normal;
    font-size: 11.8px;
    font-weight: 500;
}

.v15-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v15-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v15-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v15-link {
    color: var(--primary-dark);
    font-size: 12.2px;
    font-weight: 500;
}

.v15-link:hover {
    text-decoration: underline;
}

@media (max-width: 980px) {
    .v15-head,
    .v15-table-head,
    .v15-bulk {
        flex-direction: column;
        align-items: stretch;
    }

    .v15-filter {
        grid-template-columns: 1fr 200px auto auto auto;
    }
}

@media (max-width: 860px) {
    body:has(.v15-page) .page,
    body:has(.v15-page) .container,
    body:has(.v15-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v15-filter,
    .v15-bulk-controls {
        grid-template-columns: 1fr;
    }

    .v15-card {
        overflow-x: auto;
    }

    .v15-table {
        min-width: 860px;
    }
}


/* ===== V16 Slim Operational Screen: no title card, controls attached to table ===== */

body:has(.v16-page) {
    font-weight: 400;
}

body:has(.v16-page) strong,
body:has(.v16-page) b,
body:has(.v16-page) h1,
body:has(.v16-page) h2,
body:has(.v16-page) h3,
body:has(.v16-page) h4 {
    font-weight: 500;
}

body:has(.v16-page) .page,
body:has(.v16-page) .container,
body:has(.v16-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v16-page {
    --v16-border: #dce7eb;
    --v16-soft: #f7fafb;
    --v16-text: #253842;
    --v16-muted: #7c8b92;
    --v16-shadow: 0 6px 16px rgba(22, 50, 65, 0.035);
}

/* slim title line instead of a large title card */
.v16-stagebar {
    background: #fff;
    border: 1px solid var(--v16-border);
    border-radius: 14px;
    padding: 9px 13px;
    margin-bottom: 7px;
    box-shadow: var(--v16-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.v16-stage-title span {
    display: block;
    color: var(--primary);
    font-size: 11px;
    line-height: 1.2;
    margin-bottom: 1px;
}

.v16-stage-title h2 {
    margin: 0;
    color: var(--v16-text);
    font-size: 19px;
    line-height: 1.35;
}

.v16-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.v16-actions a,
.v16-filter button,
.v16-filter a,
.v16-bulk-controls button {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v16-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.v16-actions .is-primary,
.v16-filter button,
.v16-bulk-controls button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* top tabs only; quieter and close to data */
.v16-tabs-panel {
    background: #fff;
    border: 1px solid var(--v16-border);
    border-radius: 14px;
    padding: 9px 12px;
    margin-bottom: 7px;
    box-shadow: var(--v16-shadow);
    display: grid;
    gap: 7px;
}

.v16-main-tabs,
.v16-sub-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v16-main-tabs a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--v16-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 5px 10px;
    font-size: 12.2px;
    font-weight: 500;
}

.v16-main-tabs a.active {
    background: #f0f7f9;
    border-color: rgba(47, 113, 136, 0.45);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.v16-main-tabs b,
.v16-sub-tabs b {
    min-width: 23px;
    min-height: 19px;
    border-radius: 999px;
    background: var(--v16-soft);
    border: 1px solid var(--v16-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 10.8px;
}

.v16-sub-tabs {
    min-height: 29px;
    padding-top: 7px;
    border-top: 1px solid var(--v16-border);
}

.v16-sub-tabs a {
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--v16-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 8px;
    font-size: 11.7px;
    font-weight: 500;
}

.v16-sub-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v16-sub-tabs a.active b {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.14);
}

.v16-sub-tabs span {
    color: var(--v16-muted);
    font-size: 12px;
}

/* single data shell: toolbar + table, so search belongs to the table */
.v16-data-shell {
    background: #fff;
    border: 1px solid var(--v16-border);
    border-radius: 14px;
    padding: 10px;
    box-shadow: var(--v16-shadow);
}

.v16-table-toolbar {
    display: grid;
    grid-template-columns: auto minmax(520px, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.v16-table-toolbar h3 {
    margin: 0;
    color: var(--v16-text);
    font-size: 16px;
    line-height: 1.35;
}

.v16-table-toolbar span {
    display: block;
    color: var(--v16-muted);
    font-size: 12px;
    margin-top: 2px;
}

.v16-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 205px auto auto auto;
    gap: 7px;
    align-items: center;
}

.v16-filter input,
.v16-filter select,
.v16-bulk-controls select {
    min-height: 31px;
    border: 1px solid var(--v16-border);
    border-radius: 9px;
    background: #fff;
    color: var(--v16-text);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 12.1px;
    font-weight: 400;
}

.v16-bulk {
    display: none;
    background: #f7fafb;
    border: 1px solid var(--v16-border);
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 8px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v16-bulk.is-active {
    display: flex;
}

.v16-bulk strong {
    display: block;
    color: var(--primary-dark);
    font-size: 12.8px;
    margin-bottom: 2px;
}

.v16-bulk span {
    color: var(--v16-muted);
    font-size: 11.8px;
}

.v16-bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.v16-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v16-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v16-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v16-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.v16-table td {
    padding: 8px;
    border-bottom: 1px solid var(--v16-border);
    color: var(--v16-text);
    font-size: 12.6px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v16-table tbody tr:hover td {
    background: #fbfdfe;
}

.v16-table tbody tr.needs-review td {
    background: #fffefa;
}

.v16-table .col-check {
    width: 42px;
}

.v16-table .col-num {
    width: 44px;
}

.v16-table .col-score {
    width: 94px;
}

.v16-table .col-quality,
.v16-table .col-state {
    width: 110px;
}

.v16-table .col-process {
    width: 62px;
}

.v16-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.person-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v16-text);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.person-cell span,
.opportunity-cell span {
    display: block;
    color: var(--v16-muted);
    font-size: 11.6px;
    font-weight: 400;
    line-height: 1.45;
}

.score-cell-v16 strong {
    display: block;
    color: var(--primary-dark);
    font-size: 15.2px;
    font-weight: 500;
    line-height: 1.1;
}

.score-cell-v16 span {
    display: block;
    color: var(--v16-muted);
    font-size: 11.3px;
}

.score-cell-v16 em {
    display: inline-flex;
    border-radius: 999px;
    background: #fff6e7;
    color: var(--warning);
    padding: 3px 8px;
    font-style: normal;
    font-size: 11.6px;
    font-weight: 500;
}

.v16-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 21px;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.6px;
    font-weight: 500;
    white-space: nowrap;
}

.v16-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v16-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v16-link {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
}

.v16-link:hover {
    text-decoration: underline;
}

@media (max-width: 1120px) {
    .v16-stagebar,
    .v16-bulk {
        flex-direction: column;
        align-items: stretch;
    }

    .v16-table-toolbar {
        grid-template-columns: 1fr;
    }

    .v16-filter {
        grid-template-columns: 1fr 205px auto auto auto;
    }
}

@media (max-width: 860px) {
    body:has(.v16-page) .page,
    body:has(.v16-page) .container,
    body:has(.v16-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v16-filter,
    .v16-bulk-controls {
        grid-template-columns: 1fr;
    }

    .v16-data-shell {
        overflow-x: auto;
    }

    .v16-table {
        min-width: 860px;
    }
}


/* ===== V17 Single Data Board + Smart Action Column + Brief/Detail View ===== */

body:has(.v17-page) {
    font-weight: 400;
}

body:has(.v17-page) strong,
body:has(.v17-page) b,
body:has(.v17-page) h1,
body:has(.v17-page) h2,
body:has(.v17-page) h3,
body:has(.v17-page) h4 {
    font-weight: 500;
}

body:has(.v17-page) .page,
body:has(.v17-page) .container,
body:has(.v17-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v17-page {
    --v17-border: #dce7eb;
    --v17-soft: #f7fafb;
    --v17-text: #253842;
    --v17-muted: #7c8b92;
    --v17-shadow: 0 6px 16px rgba(22, 50, 65, 0.035);
}

.v17-board {
    background: #fff;
    border: 1px solid var(--v17-border);
    border-radius: 16px;
    padding: 11px;
    box-shadow: var(--v17-shadow);
}

.v17-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 0 9px;
    border-bottom: 1px solid var(--v17-border);
}

.v17-title span {
    display: block;
    color: var(--primary);
    font-size: 11px;
    line-height: 1.2;
    margin-bottom: 1px;
}

.v17-title h2 {
    margin: 0;
    color: var(--v17-text);
    font-size: 19px;
    line-height: 1.35;
}

.v17-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.v17-actions a,
.v17-filter button,
.v17-filter a,
.v17-bulk-controls button {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v17-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.v17-actions .is-primary,
.v17-filter button,
.v17-bulk-controls button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v17-main-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0 0;
}

.v17-main-tabs a {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--v17-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 10px;
    font-size: 12.1px;
    font-weight: 500;
}

.v17-main-tabs a.active {
    background: #f0f7f9;
    border-color: rgba(47, 113, 136, 0.45);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.v17-main-tabs b,
.v17-sub-tabs b {
    min-width: 23px;
    min-height: 19px;
    border-radius: 999px;
    background: var(--v17-soft);
    border: 1px solid var(--v17-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 10.8px;
}

.v17-sub-tabs {
    min-height: 29px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 7px 0 8px;
    border-bottom: 1px solid var(--v17-border);
}

.v17-sub-tabs a {
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--v17-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 8px;
    font-size: 11.7px;
    font-weight: 500;
}

.v17-sub-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v17-sub-tabs a.active b {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.14);
}

.v17-sub-tabs span {
    color: var(--v17-muted);
    font-size: 12px;
}

.v17-toolbar {
    display: grid;
    grid-template-columns: auto minmax(520px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 9px 0 7px;
}

.v17-table-title h3 {
    margin: 0;
    color: var(--v17-text);
    font-size: 16px;
    line-height: 1.35;
}

.v17-table-title span {
    display: block;
    color: var(--v17-muted);
    font-size: 12px;
    margin-top: 2px;
}

.v17-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 205px auto auto auto;
    gap: 7px;
    align-items: center;
}

.v17-filter input,
.v17-filter select,
.v17-bulk-controls select {
    min-height: 31px;
    border: 1px solid var(--v17-border);
    border-radius: 9px;
    background: #fff;
    color: var(--v17-text);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 12.1px;
    font-weight: 400;
}

.v17-viewline {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--v17-border);
    padding: 7px 0;
}

.v17-view-switch {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v17-view-switch span,
.v17-hint {
    color: var(--v17-muted);
    font-size: 11.8px;
}

.v17-view-switch a {
    min-height: 25px;
    border: 1px solid var(--v17-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 3px 8px;
    font-size: 11.6px;
    font-weight: 500;
}

.v17-view-switch a.active {
    background: #f0f7f9;
    border-color: rgba(47, 113, 136, 0.35);
}

.v17-bulk {
    display: none;
    background: #f7fafb;
    border: 1px solid var(--v17-border);
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 8px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v17-bulk.is-active {
    display: flex;
}

.v17-bulk strong {
    display: block;
    color: var(--primary-dark);
    font-size: 12.8px;
    margin-bottom: 2px;
}

.v17-bulk span {
    color: var(--v17-muted);
    font-size: 11.8px;
}

.v17-bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.v17-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v17-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v17-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v17-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.v17-table td {
    padding: 8px;
    border-bottom: 1px solid var(--v17-border);
    color: var(--v17-text);
    font-size: 12.6px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v17-table tbody tr:hover td {
    background: #fbfdfe;
}

.v17-table tbody tr.needs-review td {
    background: #fffefa;
}

.v17-table .col-check {
    width: 42px;
}

.v17-table .col-num {
    width: 44px;
}

.v17-table .col-score {
    width: 94px;
}

.v17-table .col-quality,
.v17-table .col-state {
    width: 110px;
}

.v17-table .col-process {
    width: 78px;
}

.v17-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.person-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v17-text);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.person-cell span,
.opportunity-cell span,
.person-cell small {
    display: block;
    color: var(--v17-muted);
    font-size: 11.6px;
    font-weight: 400;
    line-height: 1.45;
}

.score-cell-v17 strong {
    display: block;
    color: var(--primary-dark);
    font-size: 15.2px;
    font-weight: 500;
    line-height: 1.1;
}

.score-cell-v17 span {
    display: block;
    color: var(--v17-muted);
    font-size: 11.3px;
}

.score-cell-v17 em {
    display: inline-flex;
    border-radius: 999px;
    background: #fff6e7;
    color: var(--warning);
    padding: 3px 8px;
    font-style: normal;
    font-size: 11.6px;
    font-weight: 500;
}

.v17-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 21px;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.6px;
    font-weight: 500;
    white-space: nowrap;
}

.v17-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v17-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v17-link,
.v17-action-link {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
}

.v17-action-link {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v17-border);
    border-radius: 999px;
    background: #f6fafb;
    padding: 2px 8px;
}

.v17-link:hover,
.v17-action-link:hover {
    text-decoration: underline;
}

@media (max-width: 1120px) {
    .v17-board-head,
    .v17-bulk,
    .v17-viewline {
        flex-direction: column;
        align-items: stretch;
    }

    .v17-toolbar {
        grid-template-columns: 1fr;
    }

    .v17-filter {
        grid-template-columns: 1fr 205px auto auto auto;
    }
}

@media (max-width: 860px) {
    body:has(.v17-page) .page,
    body:has(.v17-page) .container,
    body:has(.v17-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v17-filter,
    .v17-bulk-controls {
        grid-template-columns: 1fr;
    }

    .v17-board {
        overflow-x: auto;
    }

    .v17-table {
        min-width: 860px;
    }
}


/* ===== V18 Refinement: view switch in toolbar + tighter tabs ===== */

body:has(.v18-page) {
    font-weight: 400;
}

body:has(.v18-page) strong,
body:has(.v18-page) b,
body:has(.v18-page) h1,
body:has(.v18-page) h2,
body:has(.v18-page) h3,
body:has(.v18-page) h4 {
    font-weight: 500;
}

body:has(.v18-page) .page,
body:has(.v18-page) .container,
body:has(.v18-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v18-page {
    --v18-border: #dce7eb;
    --v18-soft: #f7fafb;
    --v18-text: #253842;
    --v18-muted: #7c8b92;
    --v18-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v18-board {
    background: #fff;
    border: 1px solid var(--v18-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v18-shadow);
}

.v18-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v18-border);
}

.v18-title span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 1px;
}

.v18-title h2 {
    margin: 0;
    color: var(--v18-text);
    font-size: 18.5px;
    line-height: 1.35;
}

.v18-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v18-actions a,
.v18-filter button,
.v18-filter a,
.v18-bulk-controls button {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v18-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v18-actions .is-primary,
.v18-filter button,
.v18-bulk-controls button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v18-navigation {
    padding: 7px 0;
    border-bottom: 1px solid var(--v18-border);
}

.v18-main-tabs,
.v18-sub-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.v18-main-tabs {
    margin-bottom: 6px;
}

.v18-main-tabs a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--v18-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 500;
}

.v18-main-tabs a.active {
    background: #f0f7f9;
    border-color: rgba(47, 113, 136, 0.45);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.v18-main-tabs b,
.v18-sub-tabs b {
    min-width: 22px;
    min-height: 18px;
    border-radius: 999px;
    background: var(--v18-soft);
    border: 1px solid var(--v18-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 10.5px;
}

.v18-sub-tabs a {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--v18-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 500;
}

.v18-sub-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v18-sub-tabs a.active b {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.14);
}

.v18-sub-tabs span {
    color: var(--v18-muted);
    font-size: 11.8px;
}

.v18-toolbar {
    display: grid;
    grid-template-columns: auto minmax(620px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--v18-border);
}

.v18-table-title h3 {
    margin: 0;
    color: var(--v18-text);
    font-size: 15.8px;
    line-height: 1.35;
}

.v18-table-title span {
    display: block;
    color: var(--v18-muted);
    font-size: 11.8px;
    margin-top: 1px;
}

.v18-toolbar-tools {
    display: grid;
    grid-template-columns: auto minmax(520px, 1fr);
    gap: 8px;
    align-items: center;
}

.v18-view-switch {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--v18-border);
    border-radius: 999px;
    padding: 3px;
    background: #fff;
    justify-self: start;
}

.v18-view-switch a {
    min-height: 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--primary-dark);
    padding: 2px 8px;
    font-size: 11.4px;
    font-weight: 500;
}

.v18-view-switch a.active {
    background: #f0f7f9;
    box-shadow: inset 0 -1px 0 rgba(47, 113, 136, 0.18);
}

.v18-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 205px auto auto auto;
    gap: 6px;
    align-items: center;
}

.v18-filter input,
.v18-filter select,
.v18-bulk-controls select {
    min-height: 30px;
    border: 1px solid var(--v18-border);
    border-radius: 9px;
    background: #fff;
    color: var(--v18-text);
    padding: 5px 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
}

.v18-bulk {
    display: none;
    background: #f7fafb;
    border: 1px solid var(--v18-border);
    border-radius: 12px;
    padding: 8px 10px;
    margin: 8px 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.v18-bulk.is-active {
    display: flex;
}

.v18-bulk strong {
    display: block;
    color: var(--primary-dark);
    font-size: 12.8px;
    margin-bottom: 2px;
}

.v18-bulk span {
    color: var(--v18-muted);
    font-size: 11.8px;
}

.v18-bulk-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.v18-table-wrap {
    width: 100%;
    overflow-x: visible;
    padding-top: 8px;
}

.v18-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v18-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v18-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v18-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v18-border);
    color: var(--v18-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

.v18-table tbody tr:hover td {
    background: #fbfdfe;
}

.v18-table tbody tr.needs-review td {
    background: #fffefa;
}

.v18-table .col-check {
    width: 42px;
}

.v18-table .col-num {
    width: 44px;
}

.v18-table .col-score {
    width: 94px;
}

.v18-table .col-quality,
.v18-table .col-state {
    width: 110px;
}

.v18-table .col-process {
    width: 78px;
}

.v18-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.person-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v18-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.person-cell span,
.opportunity-cell span,
.person-cell small {
    display: block;
    color: var(--v18-muted);
    font-size: 11.4px;
    font-weight: 400;
    line-height: 1.42;
}

.score-cell-v18 strong {
    display: block;
    color: var(--primary-dark);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.1;
}

.score-cell-v18 span {
    display: block;
    color: var(--v18-muted);
    font-size: 11.2px;
}

.score-cell-v18 em {
    display: inline-flex;
    border-radius: 999px;
    background: #fff6e7;
    color: var(--warning);
    padding: 2px 7px;
    font-style: normal;
    font-size: 11.4px;
    font-weight: 500;
}

.v18-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v18-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v18-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v18-link,
.v18-action-link {
    color: var(--primary-dark);
    font-size: 11.8px;
    font-weight: 500;
}

.v18-action-link {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v18-border);
    border-radius: 999px;
    background: #f6fafb;
    padding: 1px 8px;
}

.v18-link:hover,
.v18-action-link:hover {
    text-decoration: underline;
}

@media (max-width: 1200px) {
    .v18-board-head,
    .v18-bulk {
        flex-direction: column;
        align-items: stretch;
    }

    .v18-toolbar,
    .v18-toolbar-tools {
        grid-template-columns: 1fr;
    }

    .v18-view-switch {
        justify-self: stretch;
        width: max-content;
    }

    .v18-filter {
        grid-template-columns: 1fr 205px auto auto auto;
    }
}

@media (max-width: 860px) {
    body:has(.v18-page) .page,
    body:has(.v18-page) .container,
    body:has(.v18-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v18-filter,
    .v18-bulk-controls {
        grid-template-columns: 1fr;
    }

    .v18-board {
        overflow-x: auto;
    }

    .v18-table {
        min-width: 860px;
    }
}


/* ===== V19 Dashboard: unified with V18 data-board style ===== */

body:has(.v19-dashboard) {
    font-weight: 400;
}

body:has(.v19-dashboard) strong,
body:has(.v19-dashboard) b,
body:has(.v19-dashboard) h1,
body:has(.v19-dashboard) h2,
body:has(.v19-dashboard) h3,
body:has(.v19-dashboard) h4 {
    font-weight: 500;
}

body:has(.v19-dashboard) .page,
body:has(.v19-dashboard) .container,
body:has(.v19-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v19-dashboard {
    --v19-border: #dce7eb;
    --v19-soft: #f7fafb;
    --v19-text: #253842;
    --v19-muted: #7c8b92;
    --v19-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v19-dashboard-board {
    background: #fff;
    border: 1px solid var(--v19-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v19-shadow);
}

.v19-dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v19-border);
}

.v19-dashboard-head span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 1px;
}

.v19-dashboard-head h2 {
    margin: 0;
    color: var(--v19-text);
    font-size: 18.5px;
    line-height: 1.35;
}

.v19-dashboard-head p {
    margin: 2px 0 0;
    color: var(--v19-muted);
    font-size: 12px;
    line-height: 1.55;
}

.v19-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v19-dashboard-actions a,
.v19-panel-action {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v19-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v19-dashboard-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v19-summary-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v19-border);
}

.v19-summary-strip div {
    min-height: 54px;
    border: 1px solid var(--v19-border);
    border-radius: 12px;
    background: var(--v19-soft);
    padding: 8px 10px;
    display: grid;
    align-content: center;
    gap: 3px;
}

.v19-summary-strip span {
    color: var(--v19-muted);
    font-size: 11.8px;
}

.v19-summary-strip strong {
    color: var(--primary-dark);
    font-size: 21px;
    line-height: 1;
}

.v19-stages-panel {
    padding-top: 8px;
}

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

.v19-panel-head h3 {
    margin: 0;
    color: var(--v19-text);
    font-size: 16px;
    line-height: 1.35;
}

.v19-panel-head p {
    margin: 2px 0 0;
    color: var(--v19-muted);
    font-size: 11.8px;
}

.v19-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v19-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v19-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v19-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v19-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v19-border);
    color: var(--v19-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

.v19-table tbody tr:hover td {
    background: #fbfdfe;
}

.v19-table .col-order {
    width: 64px;
}

.v19-table .col-action {
    width: 100px;
}

.stage-cell strong {
    display: block;
    color: var(--v19-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v19-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.v19-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v19-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v19-chip.muted {
    background: #f1f5f6;
    color: var(--v19-muted);
}

.v19-action-link {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v19-border);
    border-radius: 999px;
    background: #f6fafb;
    color: var(--primary-dark);
    padding: 1px 8px;
    font-size: 11.8px;
    font-weight: 500;
}

.v19-action-link:hover {
    text-decoration: underline;
}

@media (max-width: 1180px) {
    .v19-dashboard-head,
    .v19-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v19-summary-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    body:has(.v19-dashboard) .page,
    body:has(.v19-dashboard) .container,
    body:has(.v19-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v19-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v19-dashboard-board {
        overflow-x: auto;
    }

    .v19-table {
        min-width: 940px;
    }
}


/* ===== V20 Real Dashboard: active stage + processing indicators + workflow ===== */

body:has(.v20-dashboard) {
    font-weight: 400;
}

body:has(.v20-dashboard) strong,
body:has(.v20-dashboard) b,
body:has(.v20-dashboard) h1,
body:has(.v20-dashboard) h2,
body:has(.v20-dashboard) h3,
body:has(.v20-dashboard) h4 {
    font-weight: 500;
}

body:has(.v20-dashboard) .page,
body:has(.v20-dashboard) .container,
body:has(.v20-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v20-dashboard {
    --v20-border: #dce7eb;
    --v20-soft: #f7fafb;
    --v20-text: #253842;
    --v20-muted: #7c8b92;
    --v20-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v20-board {
    background: #fff;
    border: 1px solid var(--v20-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v20-shadow);
}

.v20-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v20-border);
}

.v20-head span,
.v20-section-label {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v20-head h2 {
    margin: 0;
    color: var(--v20-text);
    font-size: 18.5px;
    line-height: 1.35;
}

.v20-head p {
    margin: 2px 0 0;
    color: var(--v20-muted);
    font-size: 12px;
    line-height: 1.55;
}

.v20-head-actions,
.v20-active-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v20-head-actions a,
.v20-active-actions a,
.v20-panel-action {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v20-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v20-head-actions .is-primary,
.v20-active-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Decision area */
.v20-command-center {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--v20-border);
}

.v20-active-stage,
.v20-processing {
    border: 1px solid var(--v20-border);
    border-radius: 14px;
    background: var(--v20-soft);
    padding: 12px;
}

.v20-active-stage h3 {
    margin: 0;
    color: var(--v20-text);
    font-size: 20px;
    line-height: 1.45;
}

.v20-active-stage p {
    margin: 4px 0 0;
    color: var(--v20-muted);
    font-size: 12.5px;
}

.v20-stage-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 8px 0 12px;
    color: var(--v20-muted);
    font-size: 12px;
}

.v20-processing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 7px;
}

.v20-processing-grid a {
    min-height: 58px;
    border: 1px solid var(--v20-border);
    border-radius: 12px;
    background: #fff;
    padding: 8px 9px;
    display: grid;
    align-content: center;
    gap: 4px;
}

.v20-processing-grid a:first-child {
    grid-column: span 2;
}

.v20-processing-grid span {
    color: var(--v20-muted);
    font-size: 11.8px;
}

.v20-processing-grid strong {
    color: var(--primary-dark);
    font-size: 22px;
    line-height: 1;
}

.v20-processing-grid .is-warning {
    background: #fffdf8;
}

.v20-processing-grid .is-ready {
    background: #f7fcf9;
}

/* Workflow */
.v20-workflow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v20-border);
}

.v20-workflow article {
    min-height: 78px;
    border: 1px solid var(--v20-border);
    border-radius: 13px;
    background: #fff;
    padding: 10px;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 9px;
    align-items: start;
}

.v20-workflow b {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #f0f7f9;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.v20-workflow h3 {
    margin: 0 0 3px;
    color: var(--v20-text);
    font-size: 13.5px;
}

.v20-workflow p {
    margin: 0;
    color: var(--v20-muted);
    font-size: 11.8px;
    line-height: 1.6;
}

/* Light global summary */
.v20-summary-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v20-border);
}

.v20-summary-strip div {
    min-height: 48px;
    border: 1px solid var(--v20-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v20-summary-strip span {
    color: var(--v20-muted);
    font-size: 11.5px;
}

.v20-summary-strip strong {
    color: var(--primary-dark);
    font-size: 19px;
    line-height: 1;
}

/* Stages table */
.v20-stages-panel {
    padding-top: 8px;
}

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

.v20-panel-head h3 {
    margin: 0;
    color: var(--v20-text);
    font-size: 16px;
    line-height: 1.35;
}

.v20-panel-head p {
    margin: 2px 0 0;
    color: var(--v20-muted);
    font-size: 11.8px;
}

.v20-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v20-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v20-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v20-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v20-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v20-border);
    color: var(--v20-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

.v20-table tbody tr:hover td {
    background: #fbfdfe;
}

.v20-table tbody tr.is-active-stage td {
    background: #f8fcfd;
}

.v20-table .col-order {
    width: 64px;
}

.v20-table .col-action {
    width: 105px;
}

.stage-cell strong {
    display: block;
    color: var(--v20-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v20-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.v20-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v20-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v20-chip.muted {
    background: #f1f5f6;
    color: var(--v20-muted);
}

.v20-action-link {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v20-border);
    border-radius: 999px;
    background: #f6fafb;
    color: var(--primary-dark);
    padding: 1px 8px;
    font-size: 11.8px;
    font-weight: 500;
}

.v20-action-link:hover {
    text-decoration: underline;
}

@media (max-width: 1180px) {
    .v20-head,
    .v20-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v20-command-center {
        grid-template-columns: 1fr;
    }

    .v20-workflow {
        grid-template-columns: 1fr;
    }

    .v20-summary-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    body:has(.v20-dashboard) .page,
    body:has(.v20-dashboard) .container,
    body:has(.v20-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v20-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v20-dashboard-board,
    .v20-board {
        overflow-x: auto;
    }

    .v20-table {
        min-width: 940px;
    }
}


/* ===== V22 Dashboard: unified active stage card + lighter workflow + fixed table columns ===== */

body:has(.v22-dashboard) {
    font-weight: 400;
}

body:has(.v22-dashboard) strong,
body:has(.v22-dashboard) b,
body:has(.v22-dashboard) h1,
body:has(.v22-dashboard) h2,
body:has(.v22-dashboard) h3,
body:has(.v22-dashboard) h4 {
    font-weight: 500;
}

body:has(.v22-dashboard) .page,
body:has(.v22-dashboard) .container,
body:has(.v22-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v22-dashboard {
    --v22-border: #dce7eb;
    --v22-soft: #f7fafb;
    --v22-text: #253842;
    --v22-muted: #7c8b92;
    --v22-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v22-board {
    background: #fff;
    border: 1px solid var(--v22-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v22-shadow);
}

.v22-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v22-border);
}

.v22-head span,
.v22-section-label {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v22-head h2 {
    margin: 0;
    color: var(--v22-text);
    font-size: 18.5px;
    line-height: 1.35;
}

.v22-head p {
    margin: 2px 0 0;
    color: var(--v22-muted);
    font-size: 12px;
    line-height: 1.55;
}

.v22-head-actions,
.v22-active-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v22-head-actions a,
.v22-active-actions a,
.v22-panel-action {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v22-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v22-head-actions .is-primary,
.v22-active-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Active stage center */
.v22-active-center {
    padding: 10px 0;
    border-bottom: 1px solid var(--v22-border);
}

.v22-active-main {
    border: 1px solid var(--v22-border);
    border-radius: 15px;
    background: var(--v22-soft);
    padding: 12px;
}

.v22-active-titleline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.v22-active-titleline h3 {
    margin: 0;
    color: var(--v22-text);
    font-size: 21px;
    line-height: 1.45;
}

.v22-active-titleline p {
    margin: 6px 0 0;
    color: var(--v22-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v22-stage-indicators {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
}

.v22-stage-indicators a {
    min-height: 58px;
    border: 1px solid var(--v22-border);
    border-radius: 12px;
    background: #fff;
    padding: 8px 9px;
    display: grid;
    align-content: center;
    gap: 3px;
}

.v22-stage-indicators a.is-warning {
    background: #fffdf8;
}

.v22-stage-indicators a.is-ready {
    background: #f7fcf9;
}

.v22-stage-indicators span {
    color: var(--v22-muted);
    font-size: 11.7px;
}

.v22-stage-indicators strong {
    color: var(--primary-dark);
    font-size: 22px;
    line-height: 1;
}

/* Workflow as a lighter strip */
.v22-workflow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v22-border);
}

.v22-workflow article {
    min-height: 58px;
    border: 1px solid var(--v22-border);
    border-radius: 12px;
    background: #fff;
    padding: 8px 9px;
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    align-items: start;
}

.v22-workflow b {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #f0f7f9;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.v22-workflow h3 {
    margin: 0 0 2px;
    color: var(--v22-text);
    font-size: 13px;
}

.v22-workflow p {
    margin: 0;
    color: var(--v22-muted);
    font-size: 11.5px;
    line-height: 1.55;
}

/* Light global summary */
.v22-summary-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v22-border);
}

.v22-summary-strip div {
    min-height: 46px;
    border: 1px solid var(--v22-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v22-summary-strip span {
    color: var(--v22-muted);
    font-size: 11.5px;
}

.v22-summary-strip strong {
    color: var(--primary-dark);
    font-size: 19px;
    line-height: 1;
}

/* Stages table */
.v22-stages-panel {
    padding-top: 8px;
}

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

.v22-panel-head h3 {
    margin: 0;
    color: var(--v22-text);
    font-size: 16px;
    line-height: 1.35;
}

.v22-panel-head p {
    margin: 2px 0 0;
    color: var(--v22-muted);
    font-size: 11.8px;
}

.v22-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v22-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v22-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v22-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v22-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v22-border);
    color: var(--v22-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

.v22-table tbody tr:hover td {
    background: #fbfdfe;
}

.v22-table tbody tr.is-active-stage td {
    background: #f8fcfd;
}

.v22-table .col-order {
    width: 58px;
}

.v22-table .col-stage {
    width: 27%;
}

.v22-table .col-type {
    width: 13%;
}

.v22-table .col-status {
    width: 9%;
}

.v22-table .col-period {
    width: 14%;
}

.v22-table .col-action {
    width: 104px;
}

.stage-cell strong {
    display: block;
    color: var(--v22-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v22-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.v22-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v22-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v22-chip.muted {
    background: #f1f5f6;
    color: var(--v22-muted);
}

.v22-action-link {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v22-border);
    border-radius: 999px;
    background: #f6fafb;
    color: var(--primary-dark);
    padding: 1px 8px;
    font-size: 11.8px;
    font-weight: 500;
}

.v22-action-link:hover {
    text-decoration: underline;
}

@media (max-width: 1220px) {
    .v22-head,
    .v22-active-titleline,
    .v22-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v22-stage-indicators {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v22-workflow {
        grid-template-columns: 1fr;
    }

    .v22-summary-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    body:has(.v22-dashboard) .page,
    body:has(.v22-dashboard) .container,
    body:has(.v22-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v22-stage-indicators,
    .v22-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v22-board {
        overflow-x: auto;
    }

    .v22-table {
        min-width: 980px;
    }
}


/* ===== V23 Dashboard: decision center + work routes + lighter stage table ===== */

body:has(.v23-dashboard) {
    font-weight: 400;
}

body:has(.v23-dashboard) strong,
body:has(.v23-dashboard) b,
body:has(.v23-dashboard) h1,
body:has(.v23-dashboard) h2,
body:has(.v23-dashboard) h3,
body:has(.v23-dashboard) h4 {
    font-weight: 500;
}

body:has(.v23-dashboard) .page,
body:has(.v23-dashboard) .container,
body:has(.v23-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v23-dashboard {
    --v23-border: #dce7eb;
    --v23-soft: #f7fafb;
    --v23-text: #253842;
    --v23-muted: #7c8b92;
    --v23-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v23-board {
    background: #fff;
    border: 1px solid var(--v23-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v23-shadow);
}

.v23-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v23-border);
}

.v23-head span,
.v23-section-label {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v23-head h2 {
    margin: 0;
    color: var(--v23-text);
    font-size: 18.5px;
    line-height: 1.35;
}

.v23-head p {
    margin: 2px 0 0;
    color: var(--v23-muted);
    font-size: 12px;
    line-height: 1.55;
}

.v23-head-actions,
.v23-active-actions,
.v23-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.v23-head-actions a,
.v23-active-actions a,
.v23-panel-action {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v23-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v23-head-actions .is-primary,
.v23-active-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Decision center */
.v23-decision-center {
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--v23-border);
}

.v23-active-block {
    border: 1px solid var(--v23-border);
    border-radius: 15px;
    background: var(--v23-soft);
    padding: 12px;
}

.v23-active-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.v23-active-title h3 {
    margin: 0;
    color: var(--v23-text);
    font-size: 21px;
    line-height: 1.45;
}

.v23-active-title p {
    margin: 6px 0 0;
    color: var(--v23-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

/* Work routes: the primary dashboard area */
.v23-work-routes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.v23-work-routes a {
    min-height: 76px;
    border: 1px solid var(--v23-border);
    border-radius: 13px;
    background: #fff;
    padding: 9px 10px;
    display: grid;
    align-content: center;
    gap: 3px;
    position: relative;
}

.v23-work-routes a.is-urgent {
    background: #fffdf8;
}

.v23-work-routes a.is-ready {
    background: #f7fcf9;
}

.v23-work-routes span {
    color: var(--v23-muted);
    font-size: 12px;
}

.v23-work-routes strong {
    color: var(--primary-dark);
    font-size: 26px;
    line-height: 1;
}

.v23-work-routes em {
    color: var(--v23-muted);
    font-size: 11.5px;
    font-style: normal;
}

/* Stage info separated from processing actions */
.v23-stage-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.v23-stage-summary div {
    min-height: 46px;
    border: 1px solid var(--v23-border);
    border-radius: 11px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v23-stage-summary span {
    color: var(--v23-muted);
    font-size: 11.5px;
}

.v23-stage-summary strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

/* Compact workflow */
.v23-flowline {
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v23-border);
    color: var(--v23-muted);
    font-size: 12px;
}

.v23-flowline span {
    min-height: 25px;
    border: 1px solid var(--v23-border);
    border-radius: 999px;
    background: #fff;
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
}

.v23-flowline i {
    width: 24px;
    height: 1px;
    background: var(--v23-border);
}

/* Stages table */
.v23-stages-panel {
    padding-top: 8px;
}

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

.v23-panel-head h3 {
    margin: 0;
    color: var(--v23-text);
    font-size: 16px;
    line-height: 1.35;
}

.v23-panel-head p {
    margin: 2px 0 0;
    color: var(--v23-muted);
    font-size: 11.8px;
}

.v23-system-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.v23-system-summary span {
    min-height: 27px;
    border: 1px solid var(--v23-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v23-muted);
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
}

.v23-system-summary b {
    color: var(--primary-dark);
    font-size: 12px;
}

.v23-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v23-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v23-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v23-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v23-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v23-border);
    color: var(--v23-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

.v23-table tbody tr:hover td {
    background: #fbfdfe;
}

.v23-table tbody tr.is-active-stage td {
    background: #f8fcfd;
}

.v23-table .col-order {
    width: 58px;
}

.v23-table .col-stage {
    width: 29%;
}

.v23-table .col-type {
    width: 12%;
}

.v23-table .col-status {
    width: 9%;
}

.v23-table .col-period {
    width: 14%;
}

.v23-table .col-action {
    width: 104px;
}

.stage-cell strong {
    display: block;
    color: var(--v23-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v23-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.v23-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v23-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v23-chip.muted {
    background: #f1f5f6;
    color: var(--v23-muted);
}

.v23-action-link {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v23-border);
    border-radius: 999px;
    background: #f6fafb;
    color: var(--primary-dark);
    padding: 1px 8px;
    font-size: 11.8px;
    font-weight: 500;
}

.v23-action-link:hover {
    text-decoration: underline;
}

@media (max-width: 1220px) {
    .v23-head,
    .v23-active-row,
    .v23-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v23-work-routes,
    .v23-stage-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v23-flowline {
        flex-wrap: wrap;
    }

    .v23-flowline i {
        display: none;
    }
}

@media (max-width: 860px) {
    body:has(.v23-dashboard) .page,
    body:has(.v23-dashboard) .container,
    body:has(.v23-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v23-work-routes,
    .v23-stage-summary {
        grid-template-columns: 1fr;
    }

    .v23-board {
        overflow-x: auto;
    }

    .v23-table {
        min-width: 980px;
    }
}


/* ===== V24 Dashboard: stage selector + decision center for selected stage ===== */

body:has(.v24-dashboard) {
    font-weight: 400;
}

body:has(.v24-dashboard) strong,
body:has(.v24-dashboard) b,
body:has(.v24-dashboard) h1,
body:has(.v24-dashboard) h2,
body:has(.v24-dashboard) h3,
body:has(.v24-dashboard) h4 {
    font-weight: 500;
}

body:has(.v24-dashboard) .page,
body:has(.v24-dashboard) .container,
body:has(.v24-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v24-dashboard {
    --v24-border: #dce7eb;
    --v24-soft: #f7fafb;
    --v24-text: #253842;
    --v24-muted: #7c8b92;
    --v24-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v24-board {
    background: #fff;
    border: 1px solid var(--v24-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v24-shadow);
}

.v24-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v24-border);
}

.v24-head span,
.v24-section-label {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v24-head h2 {
    margin: 0;
    color: var(--v24-text);
    font-size: 18.5px;
    line-height: 1.35;
}

.v24-head p {
    margin: 2px 0 0;
    color: var(--v24-muted);
    font-size: 12px;
    line-height: 1.55;
}

.v24-head-actions,
.v24-active-actions,
.v24-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.v24-head-actions a,
.v24-active-actions a,
.v24-panel-action {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v24-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v24-head-actions .is-primary,
.v24-active-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Stage selector */
.v24-stage-selector {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--v24-border);
}

.v24-selector-title strong {
    display: block;
    color: var(--v24-text);
    font-size: 13px;
    margin-bottom: 1px;
}

.v24-selector-title span {
    color: var(--v24-muted);
    font-size: 11.7px;
}

.v24-stage-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.v24-stage-tabs a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--v24-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 10px;
    font-size: 11.8px;
    font-weight: 500;
}

.v24-stage-tabs a.active {
    background: #f0f7f9;
    border-color: rgba(47, 113, 136, 0.45);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.v24-stage-tabs b {
    min-width: 22px;
    min-height: 18px;
    border-radius: 999px;
    background: var(--v24-soft);
    border: 1px solid var(--v24-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
}

.v24-empty-selector {
    color: var(--v24-muted);
    font-size: 12px;
}

/* Decision center */
.v24-decision-center {
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--v24-border);
}

.v24-active-block {
    border: 1px solid var(--v24-border);
    border-radius: 15px;
    background: var(--v24-soft);
    padding: 12px;
}

.v24-active-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.v24-active-title h3 {
    margin: 0;
    color: var(--v24-text);
    font-size: 21px;
    line-height: 1.45;
}

.v24-active-title p {
    margin: 6px 0 0;
    color: var(--v24-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v24-work-routes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.v24-work-routes a {
    min-height: 76px;
    border: 1px solid var(--v24-border);
    border-radius: 13px;
    background: #fff;
    padding: 9px 10px;
    display: grid;
    align-content: center;
    gap: 3px;
}

.v24-work-routes a.is-urgent {
    background: #fffdf8;
}

.v24-work-routes a.is-ready {
    background: #f7fcf9;
}

.v24-work-routes span {
    color: var(--v24-muted);
    font-size: 12px;
}

.v24-work-routes strong {
    color: var(--primary-dark);
    font-size: 26px;
    line-height: 1;
}

.v24-work-routes em {
    color: var(--v24-muted);
    font-size: 11.5px;
    font-style: normal;
}

.v24-stage-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.v24-stage-summary div {
    min-height: 46px;
    border: 1px solid var(--v24-border);
    border-radius: 11px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v24-stage-summary span {
    color: var(--v24-muted);
    font-size: 11.5px;
}

.v24-stage-summary strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v24-flowline {
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v24-border);
    color: var(--v24-muted);
    font-size: 12px;
}

.v24-flowline span {
    min-height: 25px;
    border: 1px solid var(--v24-border);
    border-radius: 999px;
    background: #fff;
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
}

.v24-flowline i {
    width: 24px;
    height: 1px;
    background: var(--v24-border);
}

/* Stage comparison table */
.v24-stages-panel {
    padding-top: 8px;
}

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

.v24-panel-head h3 {
    margin: 0;
    color: var(--v24-text);
    font-size: 16px;
    line-height: 1.35;
}

.v24-panel-head p {
    margin: 2px 0 0;
    color: var(--v24-muted);
    font-size: 11.8px;
}

.v24-system-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.v24-system-summary span {
    min-height: 27px;
    border: 1px solid var(--v24-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v24-muted);
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
}

.v24-system-summary b {
    color: var(--primary-dark);
    font-size: 12px;
}

.v24-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v24-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v24-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v24-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v24-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v24-border);
    color: var(--v24-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

.v24-table tbody tr:hover td {
    background: #fbfdfe;
}

.v24-table tbody tr.is-selected-stage td {
    background: #f8fcfd;
}

.v24-table .col-order {
    width: 58px;
}

.v24-table .col-stage {
    width: 29%;
}

.v24-table .col-type {
    width: 12%;
}

.v24-table .col-status {
    width: 9%;
}

.v24-table .col-period {
    width: 14%;
}

.v24-table .col-action {
    width: 104px;
}

.stage-cell strong {
    display: block;
    color: var(--v24-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v24-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.v24-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v24-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v24-chip.muted {
    background: #f1f5f6;
    color: var(--v24-muted);
}

.v24-action-link {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v24-border);
    border-radius: 999px;
    background: #f6fafb;
    color: var(--primary-dark);
    padding: 1px 8px;
    font-size: 11.8px;
    font-weight: 500;
}

.v24-action-link:hover {
    text-decoration: underline;
}

@media (max-width: 1220px) {
    .v24-head,
    .v24-active-row,
    .v24-panel-head,
    .v24-stage-selector {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .v24-work-routes,
    .v24-stage-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v24-flowline {
        flex-wrap: wrap;
    }

    .v24-flowline i {
        display: none;
    }
}

@media (max-width: 860px) {
    body:has(.v24-dashboard) .page,
    body:has(.v24-dashboard) .container,
    body:has(.v24-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v24-work-routes,
    .v24-stage-summary {
        grid-template-columns: 1fr;
    }

    .v24-board {
        overflow-x: auto;
    }

    .v24-table {
        min-width: 980px;
    }
}


/* ===== V25 Dashboard: compact stage selector + calmer empty stages ===== */

body:has(.v25-dashboard) {
    font-weight: 400;
}

body:has(.v25-dashboard) strong,
body:has(.v25-dashboard) b,
body:has(.v25-dashboard) h1,
body:has(.v25-dashboard) h2,
body:has(.v25-dashboard) h3,
body:has(.v25-dashboard) h4 {
    font-weight: 500;
}

body:has(.v25-dashboard) .page,
body:has(.v25-dashboard) .container,
body:has(.v25-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v25-dashboard {
    --v25-border: #dce7eb;
    --v25-soft: #f7fafb;
    --v25-text: #253842;
    --v25-muted: #7c8b92;
    --v25-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v25-board {
    background: #fff;
    border: 1px solid var(--v25-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v25-shadow);
}

.v25-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v25-border);
}

.v25-head span,
.v25-section-label {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v25-head h2 {
    margin: 0;
    color: var(--v25-text);
    font-size: 18.5px;
    line-height: 1.35;
}

.v25-head p {
    margin: 2px 0 0;
    color: var(--v25-muted);
    font-size: 12px;
    line-height: 1.55;
}

.v25-head-actions,
.v25-active-actions,
.v25-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.v25-head-actions a,
.v25-active-actions a,
.v25-panel-action {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v25-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v25-head-actions .is-primary,
.v25-active-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Compact stage selector */
.v25-stage-selector {
    display: grid;
    grid-template-columns: 185px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--v25-border);
}

.v25-selector-title strong {
    display: block;
    color: var(--v25-text);
    font-size: 13px;
    margin-bottom: 1px;
}

.v25-selector-title span {
    color: var(--v25-muted);
    font-size: 11.7px;
}

.v25-stage-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.v25-stage-tabs a {
    min-width: 104px;
    min-height: 38px;
    display: grid;
    grid-template-columns: 26px 1fr auto;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--v25-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 8px;
    font-size: 11.6px;
    font-weight: 500;
}

.v25-stage-tabs a.active {
    background: #f0f7f9;
    border-color: rgba(47, 113, 136, 0.45);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.v25-stage-tabs a.is-empty:not(.active) {
    opacity: .68;
    background: #fafcfd;
}

.v25-stage-tabs .stage-index {
    width: 25px;
    height: 25px;
    border-radius: 999px;
    background: var(--v25-soft);
    border: 1px solid var(--v25-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.v25-stage-tabs .stage-kind {
    color: var(--primary-dark);
    font-size: 11.6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v25-stage-tabs b {
    min-width: 22px;
    min-height: 19px;
    border-radius: 999px;
    background: var(--v25-soft);
    border: 1px solid var(--v25-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
}

.v25-stage-tabs a.active b,
.v25-stage-tabs a.active .stage-index {
    background: #fff;
}

.v25-empty-selector {
    color: var(--v25-muted);
    font-size: 12px;
}

/* Decision center */
.v25-decision-center {
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--v25-border);
}

.v25-active-block {
    border: 1px solid var(--v25-border);
    border-radius: 15px;
    background: var(--v25-soft);
    padding: 12px;
}

.v25-active-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.v25-active-title h3 {
    margin: 0;
    color: var(--v25-text);
    font-size: 21px;
    line-height: 1.45;
}

.v25-active-title p {
    margin: 6px 0 0;
    color: var(--v25-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v25-work-routes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.v25-work-routes a {
    min-height: 76px;
    border: 1px solid var(--v25-border);
    border-radius: 13px;
    background: #fff;
    padding: 9px 10px;
    display: grid;
    align-content: center;
    gap: 3px;
}

.v25-work-routes a.is-urgent {
    background: #fffdf8;
}

.v25-work-routes a.is-ready {
    background: #f7fcf9;
}

.v25-work-routes span {
    color: var(--v25-muted);
    font-size: 12px;
}

.v25-work-routes strong {
    color: var(--primary-dark);
    font-size: 26px;
    line-height: 1;
}

.v25-work-routes em {
    color: var(--v25-muted);
    font-size: 11.5px;
    font-style: normal;
}

.v25-stage-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
}

.v25-stage-summary div {
    min-height: 46px;
    border: 1px solid var(--v25-border);
    border-radius: 11px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v25-stage-summary span {
    color: var(--v25-muted);
    font-size: 11.5px;
}

.v25-stage-summary strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v25-flowline {
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v25-border);
    color: var(--v25-muted);
    font-size: 12px;
}

.v25-flowline span {
    min-height: 25px;
    border: 1px solid var(--v25-border);
    border-radius: 999px;
    background: #fff;
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
}

.v25-flowline i {
    width: 24px;
    height: 1px;
    background: var(--v25-border);
}

/* Stage comparison table */
.v25-stages-panel {
    padding-top: 8px;
}

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

.v25-panel-head h3 {
    margin: 0;
    color: var(--v25-text);
    font-size: 16px;
    line-height: 1.35;
}

.v25-panel-head p {
    margin: 2px 0 0;
    color: var(--v25-muted);
    font-size: 11.8px;
}

.v25-system-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.v25-system-summary span {
    min-height: 27px;
    border: 1px solid var(--v25-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v25-muted);
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
}

.v25-system-summary b {
    color: var(--primary-dark);
    font-size: 12px;
}

.v25-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v25-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v25-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v25-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v25-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v25-border);
    color: var(--v25-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

.v25-table tbody tr:hover td {
    background: #fbfdfe;
}

.v25-table tbody tr.is-selected-stage td {
    background: #f8fcfd;
}

.v25-table .col-order {
    width: 58px;
}

.v25-table .col-stage {
    width: 29%;
}

.v25-table .col-type {
    width: 12%;
}

.v25-table .col-status {
    width: 9%;
}

.v25-table .col-period {
    width: 14%;
}

.v25-table .col-action {
    width: 104px;
}

.stage-cell strong {
    display: block;
    color: var(--v25-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v25-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.v25-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v25-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v25-chip.muted {
    background: #f1f5f6;
    color: var(--v25-muted);
}

.v25-action-link {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v25-border);
    border-radius: 999px;
    background: #f6fafb;
    color: var(--primary-dark);
    padding: 1px 8px;
    font-size: 11.8px;
    font-weight: 500;
}

.v25-action-link:hover {
    text-decoration: underline;
}

@media (max-width: 1220px) {
    .v25-head,
    .v25-active-row,
    .v25-panel-head,
    .v25-stage-selector {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .v25-work-routes,
    .v25-stage-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v25-flowline {
        flex-wrap: wrap;
    }

    .v25-flowline i {
        display: none;
    }
}

@media (max-width: 860px) {
    body:has(.v25-dashboard) .page,
    body:has(.v25-dashboard) .container,
    body:has(.v25-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v25-work-routes,
    .v25-stage-summary {
        grid-template-columns: 1fr;
    }

    .v25-board {
        overflow-x: auto;
    }

    .v25-table {
        min-width: 980px;
    }
}


/* ===== V27 Stage Detail: useful opportunity counts + Arabic labels + actions ===== */

body:has(.v27-stage-page) {
    font-weight: 400;
}

body:has(.v27-stage-page) strong,
body:has(.v27-stage-page) b,
body:has(.v27-stage-page) h1,
body:has(.v27-stage-page) h2,
body:has(.v27-stage-page) h3,
body:has(.v27-stage-page) h4 {
    font-weight: 500;
}

body:has(.v27-stage-page) .page,
body:has(.v27-stage-page) .container,
body:has(.v27-stage-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v27-stage-page {
    --v27-border: #dce7eb;
    --v27-soft: #f7fafb;
    --v27-text: #253842;
    --v27-muted: #7c8b92;
    --v27-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v27-stage-board {
    background: #fff;
    border: 1px solid var(--v27-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v27-shadow);
}

.v27-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v27-border);
}

.v27-stage-title span:first-child {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v27-stage-title h2 {
    margin: 0;
    color: var(--v27-text);
    font-size: 21px;
    line-height: 1.45;
}

.v27-stage-title p {
    margin: 5px 0 0;
    color: var(--v27-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.v27-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.v27-head-actions a,
.v27-workflow-strip a,
.v27-table-actionline a,
.v27-panel-tabs a,
.v27-panel-tabs button {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v27-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.v27-head-actions .is-primary,
.v27-panel-tabs .active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v27-stage-kpis {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v27-border);
}

.v27-stage-kpis a {
    min-height: 56px;
    border: 1px solid var(--v27-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v27-stage-kpis a.is-warning {
    background: #fffdf8;
}

.v27-stage-kpis a.is-ready {
    background: #f7fcf9;
}

.v27-stage-kpis span {
    color: var(--v27-muted);
    font-size: 11.5px;
}

.v27-stage-kpis strong {
    color: var(--primary-dark);
    font-size: 20px;
    line-height: 1;
}

.v27-workflow-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v27-border);
}

.v27-workflow-strip article {
    min-height: 72px;
    border: 1px solid var(--v27-border);
    border-radius: 13px;
    background: var(--v27-soft);
    padding: 9px;
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 8px;
    align-items: center;
}

.v27-workflow-strip b {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #eef6f8;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.v27-workflow-strip h3 {
    margin: 0 0 2px;
    color: var(--v27-text);
    font-size: 13px;
}

.v27-workflow-strip p {
    margin: 0;
    color: var(--v27-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.v27-content-panel {
    padding-top: 9px;
}

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

.v27-panel-head h3 {
    margin: 0;
    color: var(--v27-text);
    font-size: 16px;
    line-height: 1.35;
}

.v27-panel-head p {
    margin: 2px 0 0;
    color: var(--v27-muted);
    font-size: 11.8px;
}

.v27-panel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.v27-tab-panel {
    display: none;
}

.v27-tab-panel.active {
    display: block;
}

.v27-table-actionline {
    min-height: 35px;
    border: 1px dashed var(--v27-border);
    border-radius: 12px;
    background: #fbfdfe;
    padding: 6px 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.v27-table-actionline span {
    color: var(--v27-muted);
    font-size: 11.8px;
}

.v27-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v27-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v27-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v27-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v27-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v27-border);
    color: var(--v27-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

.v27-table tbody tr:hover td {
    background: #fbfdfe;
}

.v27-table .col-main {
    width: 32%;
}

.v27-table .col-action {
    width: 105px;
}

.v27-table .main-cell strong {
    display: block;
    color: var(--v27-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.v27-table .main-cell span {
    display: block;
    color: var(--v27-muted);
    font-size: 11.4px;
}

.v27-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v27-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v27-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v27-count {
    min-width: 28px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v27-border);
    border-radius: 999px;
    background: #f7fafb;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
}

.v27-score {
    color: var(--primary-dark);
    font-size: 14px;
}

.v27-action-link {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v27-border);
    border-radius: 999px;
    background: #f6fafb;
    color: var(--primary-dark);
    padding: 1px 8px;
    font-size: 11.8px;
    font-weight: 500;
}

@media (max-width: 1220px) {
    .v27-stage-head,
    .v27-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v27-stage-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v27-workflow-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    body:has(.v27-stage-page) .page,
    body:has(.v27-stage-page) .container,
    body:has(.v27-stage-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v27-stage-kpis,
    .v27-workflow-strip {
        grid-template-columns: 1fr;
    }

    .v27-stage-board {
        overflow-x: auto;
    }

    .v27-table {
        min-width: 900px;
    }
}


/* ===== V28 Application Detail: decision-first application file ===== */

body:has(.v28-application-page) {
    font-weight: 400;
}

body:has(.v28-application-page) strong,
body:has(.v28-application-page) b,
body:has(.v28-application-page) h1,
body:has(.v28-application-page) h2,
body:has(.v28-application-page) h3,
body:has(.v28-application-page) h4 {
    font-weight: 500;
}

body:has(.v28-application-page) .page,
body:has(.v28-application-page) .container,
body:has(.v28-application-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v28-application-page {
    --v28-border: #dce7eb;
    --v28-soft: #f7fafb;
    --v28-text: #253842;
    --v28-muted: #7c8b92;
    --v28-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v28-board {
    background: #fff;
    border: 1px solid var(--v28-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v28-shadow);
}

.v28-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v28-border);
}

.v28-head span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v28-head h2 {
    margin: 0;
    color: var(--v28-text);
    font-size: 22px;
    line-height: 1.45;
}

.v28-head p {
    margin: 4px 0 0;
    color: var(--v28-muted);
    font-size: 12px;
}

.v28-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.v28-head-actions a,
.v28-card-head a,
.v28-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v28-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v28-head-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Quick decision strip */
.v28-decision-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v28-border);
}

.v28-decision-strip div {
    min-height: 56px;
    border: 1px solid var(--v28-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v28-decision-strip span {
    color: var(--v28-muted);
    font-size: 11.5px;
}

.v28-decision-strip strong {
    color: var(--primary-dark);
    font-size: 15px;
    line-height: 1.35;
}

.v28-decision-strip strong.ok {
    color: var(--success);
}

.v28-decision-strip strong.warn {
    color: var(--warning);
}

/* Layout */
.v28-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 10px;
    padding-top: 10px;
    direction: ltr;
}

.v28-layout > * {
    direction: rtl;
}

.v28-decision-panel {
    border: 1px solid var(--v28-border);
    border-radius: 14px;
    background: var(--v28-soft);
    padding: 12px;
    align-self: start;
    position: sticky;
    top: 12px;
}

.v28-decision-panel h3 {
    margin: 0;
    color: var(--v28-text);
    font-size: 16px;
}

.v28-decision-panel p {
    margin: 4px 0 10px;
    color: var(--v28-muted);
    font-size: 11.8px;
    line-height: 1.6;
}

.v28-decision-form label {
    display: block;
    color: var(--v28-muted);
    font-size: 11.8px;
    margin-bottom: 5px;
}

.v28-decision-form textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid var(--v28-border);
    border-radius: 12px;
    background: #fff;
    padding: 9px;
    color: var(--v28-text);
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.6;
    resize: vertical;
}

.v28-action-stack {
    display: grid;
    gap: 7px;
    margin-top: 9px;
}

.v28-action-stack button {
    min-height: 36px;
    border: 1px solid var(--v28-border);
    border-radius: 10px;
    background: #fff;
    color: var(--primary-dark);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.v28-action-stack .primary-action {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v28-action-stack .warning-action {
    background: #fff8ed;
    border-color: #f1d9ad;
    color: #8a5a00;
}

.v28-note-hint {
    display: none;
    margin-top: 8px;
    border: 1px solid #f1d9ad;
    border-radius: 10px;
    background: #fff8ed;
    color: #8a5a00;
    padding: 7px;
    font-size: 11.8px;
    line-height: 1.5;
}

.v28-note-hint.show {
    display: block;
}

/* Details */
.v28-details {
    min-width: 0;
}

.v28-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.v28-card {
    border: 1px solid var(--v28-border);
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(20, 50, 70, 0.018);
}

.v28-summary-card {
    margin-bottom: 10px;
    background: var(--v28-soft);
}

.v28-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.v28-card-head h3 {
    margin: 0;
    color: var(--v28-text);
    font-size: 16px;
}

.v28-card-head p {
    margin: 2px 0 0;
    color: var(--v28-muted);
    font-size: 11.8px;
}

.v28-card-head > strong {
    color: var(--primary-dark);
    font-size: 24px;
}

.v28-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.v28-mini-grid div {
    min-height: 50px;
    border: 1px solid var(--v28-border);
    border-radius: 11px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v28-mini-grid span {
    color: var(--v28-muted);
    font-size: 11.4px;
}

.v28-mini-grid strong {
    color: var(--v28-text);
    font-size: 12.5px;
}

.v28-info-list {
    margin: 0;
}

.v28-info-list div {
    min-height: 39px;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--v28-border);
    padding: 6px 0;
}

.v28-info-list div:last-child {
    border-bottom: 0;
}

.v28-info-list dt {
    color: var(--v28-muted);
    font-size: 11.7px;
}

.v28-info-list dd {
    margin: 0;
    color: var(--v28-text);
    font-size: 12.7px;
    line-height: 1.55;
}

.v28-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v28-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v28-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v28-empty-box {
    min-height: 92px;
    border: 1px dashed var(--v28-border);
    border-radius: 12px;
    background: #fbfdfe;
    color: var(--v28-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-size: 12.5px;
}

.v28-decisions-card {
    margin-top: 10px;
}

.v28-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v28-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v28-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v28-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v28-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v28-border);
    color: var(--v28-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

@media (max-width: 1220px) {
    .v28-head,
    .v28-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v28-decision-strip,
    .v28-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v28-layout {
        grid-template-columns: 1fr;
    }

    .v28-decision-panel {
        position: static;
    }
}

@media (max-width: 860px) {
    body:has(.v28-application-page) .page,
    body:has(.v28-application-page) .container,
    body:has(.v28-application-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v28-decision-strip,
    .v28-card-grid,
    .v28-mini-grid {
        grid-template-columns: 1fr;
    }

    .v28-info-list div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .v28-board {
        overflow-x: auto;
    }

    .v28-table {
        min-width: 860px;
    }
}


/* ===== V29 Application Detail: top decision panel, no side column ===== */

body:has(.v29-application-page) {
    font-weight: 400;
}

body:has(.v29-application-page) strong,
body:has(.v29-application-page) b,
body:has(.v29-application-page) h1,
body:has(.v29-application-page) h2,
body:has(.v29-application-page) h3,
body:has(.v29-application-page) h4 {
    font-weight: 500;
}

body:has(.v29-application-page) .page,
body:has(.v29-application-page) .container,
body:has(.v29-application-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v29-application-page {
    --v29-border: #dce7eb;
    --v29-soft: #f7fafb;
    --v29-text: #253842;
    --v29-muted: #7c8b92;
    --v29-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v29-board {
    background: #fff;
    border: 1px solid var(--v29-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v29-shadow);
}

.v29-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v29-border);
}

.v29-head span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v29-head h2 {
    margin: 0;
    color: var(--v29-text);
    font-size: 22px;
    line-height: 1.45;
}

.v29-head p {
    margin: 4px 0 0;
    color: var(--v29-muted);
    font-size: 12px;
}

.v29-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.v29-head-actions a,
.v29-card-head a,
.v29-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v29-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v29-head-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Quick decision strip */
.v29-decision-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v29-border);
}

.v29-decision-strip div {
    min-height: 54px;
    border: 1px solid var(--v29-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v29-decision-strip span {
    color: var(--v29-muted);
    font-size: 11.5px;
}

.v29-decision-strip strong {
    color: var(--primary-dark);
    font-size: 15px;
    line-height: 1.35;
}

.v29-decision-strip strong.ok,
.v29-decision-badges .ok {
    color: var(--success);
}

.v29-decision-strip strong.warn,
.v29-decision-badges .warn {
    color: var(--warning);
}

/* Top decision box */
.v29-decision-box {
    border: 1px solid var(--v29-border);
    border-radius: 14px;
    background: var(--v29-soft);
    padding: 12px;
    margin: 0 0 10px;
}

.v29-decision-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.v29-decision-head h3 {
    margin: 0;
    color: var(--v29-text);
    font-size: 16px;
}

.v29-decision-head p {
    margin: 3px 0 0;
    color: var(--v29-muted);
    font-size: 11.8px;
}

.v29-decision-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v29-decision-badges span {
    min-height: 24px;
    border: 1px solid var(--v29-border);
    border-radius: 999px;
    background: #fff;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    font-size: 11.7px;
    font-weight: 500;
}

.v29-decision-form {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    gap: 10px;
    align-items: start;
}

.v29-action-groups {
    display: grid;
    grid-template-columns: .85fr 1.2fr 1fr;
    gap: 8px;
}

.v29-action-group {
    border: 1px solid var(--v29-border);
    border-radius: 12px;
    background: #fff;
    padding: 8px;
}

.v29-action-group > span {
    display: block;
    color: var(--v29-muted);
    font-size: 11.4px;
    margin-bottom: 6px;
}

.v29-action-group div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v29-action-group button {
    min-height: 32px;
    border: 1px solid var(--v29-border);
    border-radius: 9px;
    background: #fff;
    color: var(--primary-dark);
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    padding: 5px 9px;
    cursor: pointer;
}

.v29-action-group .primary-action {
    width: 100%;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v29-action-group.warning-group button {
    background: #fff8ed;
    border-color: #f1d9ad;
    color: #8a5a00;
}

.v29-note-row label {
    display: block;
    color: var(--v29-muted);
    font-size: 11.6px;
    margin-bottom: 5px;
}

.v29-note-row textarea {
    width: 100%;
    min-height: 92px;
    border: 1px solid var(--v29-border);
    border-radius: 12px;
    background: #fff;
    padding: 9px;
    color: var(--v29-text);
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.6;
    resize: vertical;
}

.v29-note-hint {
    display: none;
    margin-top: 6px;
    border: 1px solid #f1d9ad;
    border-radius: 10px;
    background: #fff8ed;
    color: #8a5a00;
    padding: 7px;
    font-size: 11.8px;
    line-height: 1.5;
}

.v29-note-hint.show {
    display: block;
}

/* Details */
.v29-details {
    min-width: 0;
}

.v29-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.v29-card {
    border: 1px solid var(--v29-border);
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(20, 50, 70, 0.018);
}

.v29-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.v29-card-head h3 {
    margin: 0;
    color: var(--v29-text);
    font-size: 16px;
}

.v29-info-list {
    margin: 0;
}

.v29-info-list div {
    min-height: 38px;
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--v29-border);
    padding: 6px 0;
}

.v29-info-list div:last-child {
    border-bottom: 0;
}

.v29-info-list dt {
    color: var(--v29-muted);
    font-size: 11.7px;
}

.v29-info-list dd {
    margin: 0;
    color: var(--v29-text);
    font-size: 12.7px;
    line-height: 1.55;
}

.v29-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v29-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v29-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v29-score-summary {
    min-height: 72px;
    border: 1px solid var(--v29-border);
    border-radius: 12px;
    background: #f7fafb;
    padding: 9px;
    display: grid;
    align-content: center;
    gap: 3px;
    margin-bottom: 7px;
}

.v29-score-summary span {
    color: var(--v29-muted);
    font-size: 11.7px;
}

.v29-score-summary strong {
    color: var(--primary-dark);
    font-size: 28px;
    line-height: 1;
}

.v29-empty-box {
    min-height: 92px;
    border: 1px dashed var(--v29-border);
    border-radius: 12px;
    background: #fbfdfe;
    color: var(--v29-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-size: 12.5px;
}

.v29-decisions-card {
    margin-top: 10px;
}

.v29-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v29-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v29-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v29-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v29-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v29-border);
    color: var(--v29-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

@media (max-width: 1240px) {
    .v29-head,
    .v29-card-head,
    .v29-decision-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v29-decision-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v29-decision-form,
    .v29-action-groups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    body:has(.v29-application-page) .page,
    body:has(.v29-application-page) .container,
    body:has(.v29-application-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v29-decision-strip,
    .v29-card-grid {
        grid-template-columns: 1fr;
    }

    .v29-info-list div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .v29-board {
        overflow-x: auto;
    }

    .v29-table {
        min-width: 860px;
    }
}


/* ===== V30 Application Detail: compact decision bar + merged basic data ===== */

body:has(.v30-application-page) {
    font-weight: 400;
}

body:has(.v30-application-page) strong,
body:has(.v30-application-page) b,
body:has(.v30-application-page) h1,
body:has(.v30-application-page) h2,
body:has(.v30-application-page) h3,
body:has(.v30-application-page) h4 {
    font-weight: 500;
}

body:has(.v30-application-page) .page,
body:has(.v30-application-page) .container,
body:has(.v30-application-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v30-application-page {
    --v30-border: #dce7eb;
    --v30-soft: #f7fafb;
    --v30-text: #253842;
    --v30-muted: #7c8b92;
    --v30-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v30-board {
    background: #fff;
    border: 1px solid var(--v30-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v30-shadow);
}

.v30-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v30-border);
}

.v30-head span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v30-head h2 {
    margin: 0;
    color: var(--v30-text);
    font-size: 22px;
    line-height: 1.45;
}

.v30-head p {
    margin: 4px 0 0;
    color: var(--v30-muted);
    font-size: 12px;
}

.v30-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.v30-head-actions a,
.v30-card-head a,
.v30-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v30-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v30-head-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Summary strip */
.v30-decision-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v30-border);
}

.v30-decision-strip div {
    min-height: 50px;
    border: 1px solid var(--v30-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v30-decision-strip span {
    color: var(--v30-muted);
    font-size: 11.4px;
}

.v30-decision-strip strong {
    color: var(--primary-dark);
    font-size: 14.5px;
    line-height: 1.35;
}

.v30-decision-strip strong.ok,
.v30-state-badges .ok {
    color: var(--success);
}

.v30-decision-strip strong.warn,
.v30-state-badges .warn {
    color: var(--warning);
}

/* Compact action bar */
.v30-action-bar {
    border: 1px solid var(--v30-border);
    border-radius: 14px;
    background: var(--v30-soft);
    padding: 10px;
    margin: 0 0 10px;
}

.v30-action-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.v30-action-head h3 {
    margin: 0;
    color: var(--v30-text);
    font-size: 16px;
}

.v30-action-head p {
    margin: 2px 0 0;
    color: var(--v30-muted);
    font-size: 11.8px;
}

.v30-state-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.v30-state-badges span {
    min-height: 23px;
    border: 1px solid var(--v30-border);
    border-radius: 999px;
    background: #fff;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
}

.v30-decision-form {
    display: grid;
    gap: 8px;
}

.v30-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v30-buttons-row button {
    min-height: 32px;
    border: 1px solid var(--v30-border);
    border-radius: 9px;
    background: #fff;
    color: var(--primary-dark);
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    padding: 5px 10px;
    cursor: pointer;
}

.v30-buttons-row .primary-action {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v30-buttons-row .warning-action {
    background: #fff8ed;
    border-color: #f1d9ad;
    color: #8a5a00;
}

.v30-note-line {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.v30-note-line label {
    color: var(--v30-muted);
    font-size: 11.7px;
    padding-top: 8px;
}

.v30-note-line textarea {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--v30-border);
    border-radius: 11px;
    background: #fff;
    padding: 8px 9px;
    color: var(--v30-text);
    font-family: inherit;
    font-size: 12.4px;
    line-height: 1.55;
    resize: vertical;
}

.v30-note-hint {
    display: none;
    grid-column: 2;
    border: 1px solid #f1d9ad;
    border-radius: 10px;
    background: #fff8ed;
    color: #8a5a00;
    padding: 7px;
    font-size: 11.8px;
    line-height: 1.5;
}

.v30-note-hint.show {
    display: block;
}

/* Details */
.v30-details {
    min-width: 0;
}

.v30-card {
    border: 1px solid var(--v30-border);
    border-radius: 14px;
    background: #fff;
    padding: 11px;
    box-shadow: 0 2px 8px rgba(20, 50, 70, 0.018);
}

.v30-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.v30-card-head h3 {
    margin: 0;
    color: var(--v30-text);
    font-size: 16px;
}

.v30-card-head p {
    margin: 2px 0 0;
    color: var(--v30-muted);
    font-size: 11.7px;
}

.v30-basic-card {
    margin-bottom: 10px;
}

.v30-basic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.v30-basic-column {
    border: 1px solid var(--v30-border);
    border-radius: 12px;
    background: #fbfdfe;
    padding: 10px;
}

.v30-basic-column h4 {
    margin: 0 0 7px;
    color: var(--primary-dark);
    font-size: 13px;
}

.v30-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.v30-info-list {
    margin: 0;
}

.v30-info-list div {
    min-height: 35px;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--v30-border);
    padding: 5px 0;
}

.v30-info-list div:last-child {
    border-bottom: 0;
}

.v30-info-list dt {
    color: var(--v30-muted);
    font-size: 11.5px;
}

.v30-info-list dd {
    margin: 0;
    color: var(--v30-text);
    font-size: 12.5px;
    line-height: 1.5;
}

.v30-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v30-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v30-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v30-score-layout {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}

.v30-score-total {
    border: 1px solid var(--v30-border);
    border-radius: 12px;
    background: #f7fafb;
    padding: 9px;
    display: grid;
    align-content: center;
    gap: 4px;
}

.v30-score-total span {
    color: var(--v30-muted);
    font-size: 11.7px;
}

.v30-score-total strong {
    color: var(--primary-dark);
    font-size: 28px;
    line-height: 1;
}

.v30-empty-box {
    min-height: 92px;
    border: 1px dashed var(--v30-border);
    border-radius: 12px;
    background: #fbfdfe;
    color: var(--v30-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-size: 12.5px;
}

.v30-decisions-card {
    margin-top: 10px;
}

.v30-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v30-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v30-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v30-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v30-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v30-border);
    color: var(--v30-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

@media (max-width: 1240px) {
    .v30-head,
    .v30-card-head,
    .v30-action-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v30-decision-strip,
    .v30-basic-grid,
    .v30-card-grid {
        grid-template-columns: 1fr;
    }

    .v30-score-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    body:has(.v30-application-page) .page,
    body:has(.v30-application-page) .container,
    body:has(.v30-application-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v30-note-line,
    .v30-info-list div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .v30-note-line label {
        padding-top: 0;
    }

    .v30-note-hint {
        grid-column: 1;
    }

    .v30-board {
        overflow-x: auto;
    }

    .v30-table {
        min-width: 860px;
    }
}


/* ===== V31 Application Detail: balanced score card ===== */

/* تفعيل شكل V31 على القالب الجديد */
body:has(.v31-application-page) {
    font-weight: 400;
}

body:has(.v31-application-page) strong,
body:has(.v31-application-page) b,
body:has(.v31-application-page) h1,
body:has(.v31-application-page) h2,
body:has(.v31-application-page) h3,
body:has(.v31-application-page) h4 {
    font-weight: 500;
}

body:has(.v31-application-page) .page,
body:has(.v31-application-page) .container,
body:has(.v31-application-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

/* نسخ القواعد العامة من V30 إلى V31 عند استخدام قالب V31 */
.v31-application-page {
    --v31-border: #dce7eb;
    --v31-soft: #f7fafb;
    --v31-text: #253842;
    --v31-muted: #7c8b92;
    --v31-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v31-board {
    background: #fff;
    border: 1px solid var(--v31-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v31-shadow);
}

.v31-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v31-border);
}

.v31-head span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v31-head h2 {
    margin: 0;
    color: var(--v31-text);
    font-size: 22px;
    line-height: 1.45;
}

.v31-head p {
    margin: 4px 0 0;
    color: var(--v31-muted);
    font-size: 12px;
}

.v31-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.v31-head-actions a,
.v31-card-head a,
.v31-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v31-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v31-head-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v31-decision-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v31-border);
}

.v31-decision-strip div {
    min-height: 50px;
    border: 1px solid var(--v31-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v31-decision-strip span {
    color: var(--v31-muted);
    font-size: 11.4px;
}

.v31-decision-strip strong {
    color: var(--primary-dark);
    font-size: 14.5px;
    line-height: 1.35;
}

.v31-decision-strip strong.ok,
.v31-state-badges .ok {
    color: var(--success);
}

.v31-decision-strip strong.warn,
.v31-state-badges .warn {
    color: var(--warning);
}

.v31-action-bar {
    border: 1px solid var(--v31-border);
    border-radius: 14px;
    background: var(--v31-soft);
    padding: 10px;
    margin: 0 0 10px;
}

.v31-action-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.v31-action-head h3 {
    margin: 0;
    color: var(--v31-text);
    font-size: 16px;
}

.v31-action-head p {
    margin: 2px 0 0;
    color: var(--v31-muted);
    font-size: 11.8px;
}

.v31-state-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.v31-state-badges span {
    min-height: 23px;
    border: 1px solid var(--v31-border);
    border-radius: 999px;
    background: #fff;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
}

.v31-decision-form {
    display: grid;
    gap: 8px;
}

.v31-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v31-buttons-row button {
    min-height: 32px;
    border: 1px solid var(--v31-border);
    border-radius: 9px;
    background: #fff;
    color: var(--primary-dark);
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    padding: 5px 10px;
    cursor: pointer;
}

.v31-buttons-row .primary-action {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v31-buttons-row .warning-action {
    background: #fff8ed;
    border-color: #f1d9ad;
    color: #8a5a00;
}

.v31-note-line {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.v31-note-line label {
    color: var(--v31-muted);
    font-size: 11.7px;
    padding-top: 8px;
}

.v31-note-line textarea {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--v31-border);
    border-radius: 11px;
    background: #fff;
    padding: 8px 9px;
    color: var(--v31-text);
    font-family: inherit;
    font-size: 12.4px;
    line-height: 1.55;
    resize: vertical;
}

.v31-note-hint {
    display: none;
    grid-column: 2;
    border: 1px solid #f1d9ad;
    border-radius: 10px;
    background: #fff8ed;
    color: #8a5a00;
    padding: 7px;
    font-size: 11.8px;
    line-height: 1.5;
}

.v31-note-hint.show {
    display: block;
}

.v31-card {
    border: 1px solid var(--v31-border);
    border-radius: 14px;
    background: #fff;
    padding: 11px;
    box-shadow: 0 2px 8px rgba(20, 50, 70, 0.018);
}

.v31-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.v31-card-head h3 {
    margin: 0;
    color: var(--v31-text);
    font-size: 16px;
}

.v31-card-head p {
    margin: 2px 0 0;
    color: var(--v31-muted);
    font-size: 11.7px;
}

.v31-basic-card {
    margin-bottom: 10px;
}

.v31-basic-grid,
.v31-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.v31-basic-column {
    border: 1px solid var(--v31-border);
    border-radius: 12px;
    background: #fbfdfe;
    padding: 10px;
}

.v31-basic-column h4 {
    margin: 0 0 7px;
    color: var(--primary-dark);
    font-size: 13px;
}

.v31-info-list,
.v31-score-list {
    margin: 0;
}

.v31-info-list div,
.v31-score-list div {
    min-height: 35px;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--v31-border);
    padding: 5px 0;
}

.v31-info-list div:last-child,
.v31-score-list div:last-child {
    border-bottom: 0;
}

.v31-info-list dt,
.v31-score-list dt {
    color: var(--v31-muted);
    font-size: 11.5px;
}

.v31-info-list dd,
.v31-score-list dd {
    margin: 0;
    color: var(--v31-text);
    font-size: 12.5px;
    line-height: 1.5;
}

/* بطاقة الدرجات الجديدة */
.v31-score-card {
    padding: 10px 11px;
}

.v31-score-head {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--v31-border);
}

.v31-score-head h3 {
    margin: 0;
    color: var(--v31-text);
    font-size: 16px;
}

.v31-score-head p {
    margin: 2px 0 0;
    color: var(--v31-muted);
    font-size: 11.6px;
}

.v31-score-badge {
    min-width: 126px;
    min-height: 44px;
    border: 1px solid var(--v31-border);
    border-radius: 12px;
    background: #f7fafb;
    padding: 6px 10px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v31-score-badge span {
    color: var(--v31-muted);
    font-size: 11.2px;
}

.v31-score-badge strong {
    color: var(--primary-dark);
    font-size: 22px;
    line-height: 1;
}

.v31-score-list {
    padding-top: 2px;
}

.v31-score-list div {
    min-height: 36px;
}

.v31-score-list dd {
    color: var(--v31-text);
    font-weight: 500;
}

.v31-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v31-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v31-chip.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v31-empty-box {
    min-height: 82px;
    border: 1px dashed var(--v31-border);
    border-radius: 12px;
    background: #fbfdfe;
    color: var(--v31-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    font-size: 12.5px;
}

.v31-decisions-card {
    margin-top: 10px;
}

.v31-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v31-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v31-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v31-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v31-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v31-border);
    color: var(--v31-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.43;
    vertical-align: middle;
}

@media (max-width: 1240px) {
    .v31-head,
    .v31-card-head,
    .v31-action-head,
    .v31-score-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v31-decision-strip,
    .v31-basic-grid,
    .v31-card-grid {
        grid-template-columns: 1fr;
    }

    .v31-score-badge {
        width: 100%;
    }
}

@media (max-width: 860px) {
    body:has(.v31-application-page) .page,
    body:has(.v31-application-page) .container,
    body:has(.v31-application-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v31-note-line,
    .v31-info-list div,
    .v31-score-list div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .v31-note-line label {
        padding-top: 0;
    }

    .v31-note-hint {
        grid-column: 1;
    }

    .v31-board {
        overflow-x: auto;
    }

    .v31-table {
        min-width: 860px;
    }
}


/* ===== V33 Cairo Font Restore ===== */

html,
body,
button,
input,
select,
textarea,
table,
th,
td,
a,
span,
p,
div,
label {
    font-family: "Cairo", "Tahoma", "Arial", sans-serif !important;
}

body {
    font-weight: 400;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b,
.topbar__title {
    font-weight: 500;
}

.topbar__subtitle,
.topbar__eyebrow,
small,
.help-text,
.text-muted {
    font-weight: 400;
}

/* منع رجوع أي خط افتراضي داخل الجداول أو النماذج */
table *,
form *,
button,
input,
select,
textarea {
    font-family: "Cairo", "Tahoma", "Arial", sans-serif !important;
}


/* ===== V34 Stage List: practical stage management page ===== */

body:has(.v34-stages-page) {
    font-weight: 400;
}

body:has(.v34-stages-page) strong,
body:has(.v34-stages-page) b,
body:has(.v34-stages-page) h1,
body:has(.v34-stages-page) h2,
body:has(.v34-stages-page) h3,
body:has(.v34-stages-page) h4 {
    font-weight: 500;
}

body:has(.v34-stages-page) .page,
body:has(.v34-stages-page) .container,
body:has(.v34-stages-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v34-stages-page {
    --v34-border: #dce7eb;
    --v34-soft: #f7fafb;
    --v34-text: #253842;
    --v34-muted: #7c8b92;
    --v34-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v34-board {
    background: #fff;
    border: 1px solid var(--v34-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v34-shadow);
}

.v34-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--v34-border);
}

.v34-hero span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v34-hero h2 {
    margin: 0;
    color: var(--v34-text);
    font-size: 22px;
    line-height: 1.45;
}

.v34-hero p {
    margin: 4px 0 0;
    color: var(--v34-muted);
    font-size: 12.5px;
    line-height: 1.65;
}

.v34-hero-actions,
.v34-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v34-hero-actions a,
.v34-panel-head a,
.v34-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v34-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v34-hero-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* KPIs */
.v34-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v34-border);
}

.v34-kpis div {
    min-height: 54px;
    border: 1px solid var(--v34-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v34-kpis span {
    color: var(--v34-muted);
    font-size: 11.5px;
}

.v34-kpis strong {
    color: var(--primary-dark);
    font-size: 20px;
    line-height: 1;
}

/* Compact stage strip */
.v34-stage-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v34-border);
}

.v34-stage-strip a {
    min-height: 58px;
    border: 1px solid var(--v34-border);
    border-radius: 13px;
    background: var(--v34-soft);
    padding: 8px 9px;
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 7px;
}

.v34-stage-strip a.has-data {
    background: #f7fcfd;
    border-color: rgba(47, 113, 136, .32);
}

.v34-stage-strip a.is-empty {
    opacity: .78;
}

.v34-stage-strip b {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--v34-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.v34-stage-strip span {
    color: var(--v34-text);
    font-size: 12.5px;
    font-weight: 500;
}

.v34-stage-strip em {
    color: var(--v34-muted);
    font-size: 11.5px;
    font-style: normal;
    white-space: nowrap;
}

.v34-empty-strip {
    grid-column: 1 / -1;
    min-height: 48px;
    border: 1px dashed var(--v34-border);
    border-radius: 12px;
    color: var(--v34-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Table panel */
.v34-table-panel {
    padding-top: 9px;
}

.v34-panel-head {
    justify-content: space-between;
    margin-bottom: 8px;
}

.v34-panel-head h3 {
    margin: 0;
    color: var(--v34-text);
    font-size: 16px;
    line-height: 1.35;
}

.v34-panel-head p {
    margin: 2px 0 0;
    color: var(--v34-muted);
    font-size: 11.8px;
}

.v34-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v34-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v34-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v34-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v34-table td {
    padding: 7.5px 8px;
    border-bottom: 1px solid var(--v34-border);
    color: var(--v34-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v34-table tbody tr:hover td {
    background: #fbfdfe;
}

.v34-table tbody tr.is-empty td {
    color: #6d7d84;
}

.v34-table .col-order {
    width: 58px;
}

.v34-table .col-stage {
    width: 30%;
}

.v34-table .col-action {
    width: 105px;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.stage-cell strong {
    display: block;
    color: var(--v34-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v34-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.v34-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v34-chip.ok {
    background: #edf8f2;
    color: var(--success);
}

.v34-chip.muted {
    background: #f1f5f6;
    color: var(--v34-muted);
}

@media (max-width: 1220px) {
    .v34-hero,
    .v34-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v34-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v34-stage-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v34-table-wrap {
        overflow-x: auto;
    }

    .v34-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v34-stages-page) .page,
    body:has(.v34-stages-page) .container,
    body:has(.v34-stages-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v34-kpis,
    .v34-stage-strip {
        grid-template-columns: 1fr;
    }
}


/* ===== V35 Dashboard: focused stage control without repetition ===== */

body:has(.v35-dashboard) {
    font-weight: 400;
}

body:has(.v35-dashboard) strong,
body:has(.v35-dashboard) b,
body:has(.v35-dashboard) h1,
body:has(.v35-dashboard) h2,
body:has(.v35-dashboard) h3,
body:has(.v35-dashboard) h4 {
    font-weight: 500;
}

body:has(.v35-dashboard) .page,
body:has(.v35-dashboard) .container,
body:has(.v35-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v35-dashboard {
    --v35-border: #dce7eb;
    --v35-soft: #f7fafb;
    --v35-text: #253842;
    --v35-muted: #7c8b92;
    --v35-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v35-board {
    background: #fff;
    border: 1px solid var(--v35-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v35-shadow);
}

/* Header */
.v35-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--v35-border);
}

.v35-hero span,
.v35-active-title > span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v35-hero h2,
.v35-active-title h3 {
    margin: 0;
    color: var(--v35-text);
    font-size: 22px;
    line-height: 1.45;
}

.v35-hero p,
.v35-active-title p {
    margin: 4px 0 0;
    color: var(--v35-muted);
    font-size: 12.4px;
    line-height: 1.65;
}

.v35-hero-actions,
.v35-active-actions,
.v35-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v35-hero-actions a,
.v35-active-actions a,
.v35-panel-head a,
.v35-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v35-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v35-hero-actions .is-primary,
.v35-active-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* System strip */
.v35-system-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v35-border);
}

.v35-system-strip div {
    min-height: 48px;
    border: 1px solid var(--v35-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v35-system-strip span {
    color: var(--v35-muted);
    font-size: 11.4px;
}

.v35-system-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

/* Stage picker */
.v35-stage-picker {
    padding: 9px 0;
    border-bottom: 1px solid var(--v35-border);
}

.v35-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}

.v35-section-head h3,
.v35-panel-head h3 {
    margin: 0;
    color: var(--v35-text);
    font-size: 15.5px;
    line-height: 1.35;
}

.v35-section-head p,
.v35-panel-head p {
    margin: 2px 0 0;
    color: var(--v35-muted);
    font-size: 11.8px;
}

.v35-stage-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.v35-stage-tabs a {
    min-height: 56px;
    border: 1px solid var(--v35-border);
    border-radius: 13px;
    background: var(--v35-soft);
    padding: 8px 9px;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 7px;
}

.v35-stage-tabs a.active {
    background: #f7fcfd;
    border-color: rgba(47, 113, 136, .46);
    box-shadow: inset 0 0 0 1px rgba(47, 113, 136, .12);
}

.v35-stage-tabs a.is-empty {
    opacity: .78;
}

.v35-stage-tabs b {
    width: 27px;
    height: 27px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--v35-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.v35-stage-tabs span {
    color: var(--v35-text);
    font-size: 12.5px;
    font-weight: 500;
}

.v35-stage-tabs em {
    color: var(--v35-muted);
    font-size: 11.5px;
    font-style: normal;
    white-space: nowrap;
}

/* Active stage center */
.v35-active-stage {
    padding: 10px 0;
    border-bottom: 1px solid var(--v35-border);
}

.v35-active-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.v35-active-title p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v35-work-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
}

.v35-work-kpis a {
    min-height: 54px;
    border: 1px solid var(--v35-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v35-work-kpis a.is-warning {
    background: #fffdf8;
}

.v35-work-kpis a.is-ready {
    background: #f7fcf9;
}

.v35-work-kpis span {
    color: var(--v35-muted);
    font-size: 11.4px;
}

.v35-work-kpis strong {
    color: var(--primary-dark);
    font-size: 19px;
    line-height: 1;
}

/* Flow line */
.v35-flowline {
    min-height: 40px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v35-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.v35-flowline span {
    min-height: 24px;
    border: 1px solid var(--v35-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v35-muted);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
}

.v35-flowline i {
    width: 28px;
    height: 1px;
    background: var(--v35-border);
}

/* Table */
.v35-stages-panel {
    padding-top: 9px;
}

.v35-panel-head {
    justify-content: space-between;
    margin-bottom: 8px;
}

.v35-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v35-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v35-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v35-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v35-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v35-border);
    color: var(--v35-text);
    font-size: 12.4px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v35-table tbody tr:hover td {
    background: #fbfdfe;
}

.v35-table tbody tr.is-selected td {
    background: #fbfdfe;
}

.v35-table tbody tr.is-empty td {
    color: #6d7d84;
}

.v35-table .col-order {
    width: 54px;
}

.v35-table .col-stage {
    width: 28%;
}

.v35-table .col-action {
    width: 105px;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.stage-cell strong {
    display: block;
    color: var(--v35-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v35-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.v35-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v35-empty-stage-tabs {
    grid-column: 1 / -1;
    min-height: 48px;
    border: 1px dashed var(--v35-border);
    border-radius: 12px;
    color: var(--v35-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1220px) {
    .v35-hero,
    .v35-active-main,
    .v35-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v35-system-strip,
    .v35-work-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v35-stage-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v35-table-wrap {
        overflow-x: auto;
    }

    .v35-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v35-dashboard) .page,
    body:has(.v35-dashboard) .container,
    body:has(.v35-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v35-system-strip,
    .v35-stage-tabs,
    .v35-work-kpis {
        grid-template-columns: 1fr;
    }

    .v35-flowline {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .v35-flowline i {
        display: none;
    }
}


/* ===== V36 Dashboard: processing-first control center ===== */

body:has(.v36-dashboard) {
    font-weight: 400;
}

body:has(.v36-dashboard) strong,
body:has(.v36-dashboard) b,
body:has(.v36-dashboard) h1,
body:has(.v36-dashboard) h2,
body:has(.v36-dashboard) h3,
body:has(.v36-dashboard) h4 {
    font-weight: 500;
}

body:has(.v36-dashboard) .page,
body:has(.v36-dashboard) .container,
body:has(.v36-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v36-dashboard {
    --v36-border: #dce7eb;
    --v36-soft: #f7fafb;
    --v36-text: #253842;
    --v36-muted: #7c8b92;
    --v36-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v36-board {
    background: #fff;
    border: 1px solid var(--v36-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v36-shadow);
}

.v36-hero,
.v36-focus-head,
.v36-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v36-hero {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--v36-border);
}

.v36-hero span,
.v36-focus-title > span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v36-hero h2,
.v36-focus-title h3 {
    margin: 0;
    color: var(--v36-text);
    font-size: 22px;
    line-height: 1.45;
}

.v36-hero p,
.v36-focus-title p {
    margin: 4px 0 0;
    color: var(--v36-muted);
    font-size: 12.4px;
    line-height: 1.65;
}

.v36-hero-actions,
.v36-action-bar,
.v36-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v36-hero-actions a,
.v36-action-bar a,
.v36-panel-head a,
.v36-action-link,
.v36-ready-card a,
.v36-total-card a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v36-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v36-hero-actions .is-primary,
.v36-action-bar .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* System summary */
.v36-system-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v36-border);
}

.v36-system-strip div {
    min-height: 46px;
    border: 1px solid var(--v36-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v36-system-strip span {
    color: var(--v36-muted);
    font-size: 11.3px;
}

.v36-system-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

/* Stage picker */
.v36-stage-picker {
    padding: 9px 0;
    border-bottom: 1px solid var(--v36-border);
}

.v36-section-head {
    margin-bottom: 7px;
}

.v36-section-head h3,
.v36-panel-head h3 {
    margin: 0;
    color: var(--v36-text);
    font-size: 15.5px;
    line-height: 1.35;
}

.v36-section-head p,
.v36-panel-head p {
    margin: 2px 0 0;
    color: var(--v36-muted);
    font-size: 11.8px;
}

.v36-stage-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.v36-stage-tabs a {
    min-height: 58px;
    border: 1px solid var(--v36-border);
    border-radius: 13px;
    background: var(--v36-soft);
    padding: 8px 9px;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 7px;
}

.v36-stage-tabs a.active {
    background: #f7fcfd;
    border-color: rgba(47, 113, 136, .48);
    box-shadow: inset 0 0 0 1px rgba(47, 113, 136, .13);
}

.v36-stage-tabs a.is-empty {
    opacity: .78;
}

.v36-stage-tabs b {
    width: 27px;
    height: 27px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--v36-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.v36-stage-tabs span {
    color: var(--v36-text);
    font-size: 12.5px;
    font-weight: 500;
}

.v36-stage-tabs em {
    color: var(--v36-muted);
    font-size: 11.5px;
    font-style: normal;
    white-space: nowrap;
}

/* Focus center */
.v36-focus {
    padding: 10px 0;
    border-bottom: 1px solid var(--v36-border);
}

.v36-focus-head {
    margin-bottom: 8px;
}

.v36-focus-title p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

/* Processing-first layout */
.v36-work-center {
    display: grid;
    grid-template-columns: 1.55fr .8fr .8fr 1fr;
    gap: 8px;
}

.v36-processing-card,
.v36-ready-card,
.v36-total-card,
.v36-small-metrics {
    border: 1px solid var(--v36-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

.v36-processing-card {
    background: #fffdf8;
    border-color: #ead7ac;
}

.v36-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.v36-mini-head span,
.v36-ready-card > span,
.v36-total-card > span {
    color: var(--v36-muted);
    font-size: 11.8px;
}

.v36-mini-head strong {
    color: var(--warning);
    font-size: 24px;
    line-height: 1;
}

.v36-processing-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.v36-processing-items a {
    min-height: 56px;
    border: 1px solid #ead7ac;
    border-radius: 12px;
    background: #fff8ed;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v36-processing-items span,
.v36-small-metrics span {
    color: var(--v36-muted);
    font-size: 11.5px;
}

.v36-processing-items strong {
    color: var(--warning);
    font-size: 20px;
    line-height: 1;
}

.v36-ready-card {
    background: #f7fcf9;
    border-color: #cfe8dc;
    display: grid;
    align-content: center;
    gap: 6px;
}

.v36-ready-card strong {
    color: var(--success);
    font-size: 28px;
    line-height: 1;
}

.v36-total-card {
    display: grid;
    align-content: center;
    gap: 6px;
}

.v36-total-card strong {
    color: var(--primary-dark);
    font-size: 28px;
    line-height: 1;
}

.v36-small-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: var(--v36-soft);
}

.v36-small-metrics a {
    min-height: 38px;
    border: 1px solid var(--v36-border);
    border-radius: 10px;
    background: #fff;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v36-small-metrics strong {
    color: var(--primary-dark);
    font-size: 16px;
}

/* Flow */
.v36-flowline {
    min-height: 38px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v36-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.v36-flowline span {
    min-height: 24px;
    border: 1px solid var(--v36-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v36-muted);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
}

.v36-flowline i {
    width: 28px;
    height: 1px;
    background: var(--v36-border);
}

/* Comparison */
.v36-stages-panel {
    padding-top: 9px;
}

.v36-panel-head {
    margin-bottom: 8px;
}

.v36-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v36-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v36-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v36-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v36-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v36-border);
    color: var(--v36-text);
    font-size: 12.4px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v36-table tbody tr:hover td,
.v36-table tbody tr.is-selected td {
    background: #fbfdfe;
}

.v36-table tbody tr.is-empty td {
    color: #6d7d84;
}

.v36-table .col-order {
    width: 54px;
}

.v36-table .col-stage {
    width: 31%;
}

.v36-table .col-action {
    width: 105px;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.stage-cell strong {
    display: block;
    color: var(--v36-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v36-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.v36-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v36-empty-stage-tabs {
    grid-column: 1 / -1;
    min-height: 48px;
    border: 1px dashed var(--v36-border);
    border-radius: 12px;
    color: var(--v36-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1220px) {
    .v36-hero,
    .v36-focus-head,
    .v36-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v36-system-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v36-stage-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v36-work-center {
        grid-template-columns: 1fr 1fr;
    }

    .v36-small-metrics {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v36-table-wrap {
        overflow-x: auto;
    }

    .v36-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v36-dashboard) .page,
    body:has(.v36-dashboard) .container,
    body:has(.v36-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v36-system-strip,
    .v36-stage-tabs,
    .v36-work-center,
    .v36-processing-items,
    .v36-small-metrics {
        grid-template-columns: 1fr;
    }

    .v36-flowline {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .v36-flowline i {
        display: none;
    }
}


/* ===== V37 Dashboard: final polish for follow-up center ===== */

body:has(.v37-dashboard) {
    font-weight: 400;
}

body:has(.v37-dashboard) strong,
body:has(.v37-dashboard) b,
body:has(.v37-dashboard) h1,
body:has(.v37-dashboard) h2,
body:has(.v37-dashboard) h3,
body:has(.v37-dashboard) h4 {
    font-weight: 500;
}

body:has(.v37-dashboard) .page,
body:has(.v37-dashboard) .container,
body:has(.v37-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v37-dashboard {
    --v37-border: #dce7eb;
    --v37-soft: #f7fafb;
    --v37-text: #253842;
    --v37-muted: #7c8b92;
    --v37-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v37-board {
    background: #fff;
    border: 1px solid var(--v37-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v37-shadow);
}

.v37-hero,
.v37-focus-head,
.v37-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v37-hero {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--v37-border);
}

.v37-hero span,
.v37-focus-title > span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v37-hero h2,
.v37-focus-title h3 {
    margin: 0;
    color: var(--v37-text);
    font-size: 22px;
    line-height: 1.45;
}

.v37-hero p,
.v37-focus-title p {
    margin: 4px 0 0;
    color: var(--v37-muted);
    font-size: 12.4px;
    line-height: 1.65;
}

.v37-hero-actions,
.v37-action-bar,
.v37-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v37-hero-actions a,
.v37-action-bar a,
.v37-panel-head a,
.v37-action-link,
.v37-ready-card a,
.v37-total-card a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v37-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v37-hero-actions .is-primary,
.v37-action-bar .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ملخص النظام */
.v37-system-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v37-border);
}

.v37-system-strip div {
    min-height: 46px;
    border: 1px solid var(--v37-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v37-system-strip span {
    color: var(--v37-muted);
    font-size: 11.3px;
}

.v37-system-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

/* اختيار المرحلة */
.v37-stage-picker {
    padding: 9px 0;
    border-bottom: 1px solid var(--v37-border);
}

.v37-section-head {
    margin-bottom: 7px;
}

.v37-section-head h3,
.v37-panel-head h3 {
    margin: 0;
    color: var(--v37-text);
    font-size: 15.5px;
    line-height: 1.35;
}

.v37-section-head p,
.v37-panel-head p {
    margin: 2px 0 0;
    color: var(--v37-muted);
    font-size: 11.8px;
}

.v37-stage-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.v37-stage-tabs a {
    min-height: 58px;
    border: 1px solid var(--v37-border);
    border-radius: 13px;
    background: var(--v37-soft);
    padding: 8px 9px;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 7px;
}

.v37-stage-tabs a.active {
    background: #f7fcfd;
    border-color: rgba(47, 113, 136, .48);
    box-shadow: inset 0 0 0 1px rgba(47, 113, 136, .13);
}

.v37-stage-tabs a.is-empty {
    opacity: .78;
}

.v37-stage-tabs b {
    width: 27px;
    height: 27px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--v37-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.v37-stage-tabs span {
    color: var(--v37-text);
    font-size: 12.5px;
    font-weight: 500;
}

.v37-stage-tabs em {
    color: var(--v37-muted);
    font-size: 11.5px;
    font-style: normal;
    white-space: nowrap;
}

/* مركز متابعة المرحلة */
.v37-focus {
    padding: 10px 0;
    border-bottom: 1px solid var(--v37-border);
}

.v37-focus-head {
    margin-bottom: 8px;
}

.v37-focus-title p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v37-action-bar {
    border: 1px solid var(--v37-border);
    border-radius: 12px;
    background: var(--v37-soft);
    padding: 6px;
}

/* ترتيب الأولوية */
.v37-work-center {
    display: grid;
    grid-template-columns: 1.55fr .82fr .72fr .92fr;
    gap: 8px;
}

.v37-priority-card,
.v37-ready-card,
.v37-total-card,
.v37-small-metrics {
    border: 1px solid var(--v37-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

.v37-priority-card {
    background: #fffdf8;
    border-color: #ead7ac;
}

.v37-priority-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.v37-priority-head span {
    display: block;
    color: var(--warning);
    font-size: 11.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v37-priority-head h4 {
    margin: 0;
    color: var(--v37-text);
    font-size: 13px;
    line-height: 1.35;
}

.v37-priority-head strong {
    color: var(--warning);
    font-size: 26px;
    line-height: 1;
}

.v37-priority-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.v37-priority-items a {
    min-height: 56px;
    border: 1px solid #ead7ac;
    border-radius: 12px;
    background: #fff8ed;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v37-priority-items span,
.v37-small-metrics span,
.v37-ready-card > span,
.v37-total-card > span {
    color: var(--v37-muted);
    font-size: 11.5px;
}

.v37-priority-items strong {
    color: var(--warning);
    font-size: 20px;
    line-height: 1;
}

.v37-ready-card {
    background: #f7fcf9;
    border-color: #cfe8dc;
    display: grid;
    align-content: center;
    gap: 6px;
}

.v37-ready-card strong {
    color: var(--success);
    font-size: 30px;
    line-height: 1;
}

.v37-total-card {
    display: grid;
    align-content: center;
    gap: 6px;
    background: #fbfdfe;
}

.v37-total-card strong {
    color: var(--primary-dark);
    font-size: 24px;
    line-height: 1;
}

.v37-small-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: var(--v37-soft);
}

.v37-small-metrics a {
    min-height: 38px;
    border: 1px solid var(--v37-border);
    border-radius: 10px;
    background: #fff;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v37-small-metrics strong {
    color: var(--primary-dark);
    font-size: 16px;
}

/* مسار العمل */
.v37-flowline {
    min-height: 38px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v37-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.v37-flowline span {
    min-height: 24px;
    border: 1px solid var(--v37-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v37-muted);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
}

.v37-flowline i {
    width: 28px;
    height: 1px;
    background: var(--v37-border);
}

/* جدول المقارنة */
.v37-stages-panel {
    padding-top: 9px;
}

.v37-panel-head {
    margin-bottom: 8px;
}

.v37-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v37-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v37-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v37-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v37-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v37-border);
    color: var(--v37-text);
    font-size: 12.4px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v37-table tbody tr:hover td,
.v37-table tbody tr.is-selected td {
    background: #fbfdfe;
}

.v37-table tbody tr.is-empty td {
    color: #6d7d84;
}

.v37-table .col-order {
    width: 54px;
}

.v37-table .col-stage {
    width: 31%;
}

.v37-table .col-action {
    width: 105px;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.stage-cell strong {
    display: block;
    color: var(--v37-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v37-muted);
    font-size: 11.4px;
    line-height: 1.42;
}

.v37-chip,
.v37-table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v37-table-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v37-table-badge.warn {
    background: #fff6e7;
    color: var(--warning);
}

.v37-empty-stage-tabs {
    grid-column: 1 / -1;
    min-height: 48px;
    border: 1px dashed var(--v37-border);
    border-radius: 12px;
    color: var(--v37-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1220px) {
    .v37-hero,
    .v37-focus-head,
    .v37-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v37-system-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v37-stage-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v37-work-center {
        grid-template-columns: 1fr 1fr;
    }

    .v37-small-metrics {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v37-table-wrap {
        overflow-x: auto;
    }

    .v37-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v37-dashboard) .page,
    body:has(.v37-dashboard) .container,
    body:has(.v37-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v37-system-strip,
    .v37-stage-tabs,
    .v37-work-center,
    .v37-priority-items,
    .v37-small-metrics {
        grid-template-columns: 1fr;
    }

    .v37-flowline {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .v37-flowline i {
        display: none;
    }
}


/* ===== V38 Dashboard: final balance polish ===== */

body:has(.v38-dashboard) {
    font-weight: 400;
}

body:has(.v38-dashboard) strong,
body:has(.v38-dashboard) b,
body:has(.v38-dashboard) h1,
body:has(.v38-dashboard) h2,
body:has(.v38-dashboard) h3,
body:has(.v38-dashboard) h4 {
    font-weight: 500;
}

body:has(.v38-dashboard) .page,
body:has(.v38-dashboard) .container,
body:has(.v38-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v38-dashboard {
    --v38-border: #dce7eb;
    --v38-soft: #f7fafb;
    --v38-text: #253842;
    --v38-muted: #7c8b92;
    --v38-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
    --v38-warn-bg: #fffaf0;
    --v38-warn-border: #ecd9af;
    --v38-ready-bg: #f8fcfa;
    --v38-ready-border: #d5eadf;
}

.v38-board {
    background: #fff;
    border: 1px solid var(--v38-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v38-shadow);
}

.v38-hero,
.v38-focus-head,
.v38-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v38-hero {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--v38-border);
}

.v38-hero span,
.v38-focus-title > span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v38-hero h2,
.v38-focus-title h3 {
    margin: 0;
    color: var(--v38-text);
    font-size: 22px;
    line-height: 1.45;
}

.v38-hero p,
.v38-focus-title p {
    margin: 4px 0 0;
    color: var(--v38-muted);
    font-size: 12.4px;
    line-height: 1.65;
}

.v38-hero-actions,
.v38-action-bar,
.v38-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v38-hero-actions a,
.v38-action-bar a,
.v38-panel-head a,
.v38-action-link,
.v38-ready-card a,
.v38-total-card a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v38-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v38-hero-actions .is-primary,
.v38-action-bar .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ملخص النظام */
.v38-system-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v38-border);
}

.v38-system-strip div {
    min-height: 44px;
    border: 1px solid var(--v38-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v38-system-strip span {
    color: var(--v38-muted);
    font-size: 11.2px;
}

.v38-system-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

/* اختيار المرحلة */
.v38-stage-picker {
    padding: 8px 0;
    border-bottom: 1px solid var(--v38-border);
}

.v38-section-head {
    margin-bottom: 7px;
}

.v38-section-head h3,
.v38-panel-head h3 {
    margin: 0;
    color: var(--v38-text);
    font-size: 15.5px;
    line-height: 1.35;
}

.v38-section-head p,
.v38-panel-head p {
    margin: 2px 0 0;
    color: var(--v38-muted);
    font-size: 11.8px;
}

.v38-stage-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.v38-stage-tabs a {
    min-height: 54px;
    border: 1px solid var(--v38-border);
    border-radius: 13px;
    background: #fbfdfe;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 7px;
}

.v38-stage-tabs a.active {
    background: #f7fcfd;
    border-color: rgba(47, 113, 136, .48);
    box-shadow: inset 0 0 0 1px rgba(47, 113, 136, .13);
}

.v38-stage-tabs a.is-empty {
    opacity: .76;
}

.v38-stage-tabs b {
    width: 27px;
    height: 27px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--v38-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.v38-stage-tabs span {
    color: var(--v38-text);
    font-size: 12.4px;
    font-weight: 500;
}

.v38-stage-tabs em {
    color: var(--v38-muted);
    font-size: 11.4px;
    font-style: normal;
    white-space: nowrap;
}

/* مركز متابعة المرحلة */
.v38-focus {
    padding: 9px 0;
    border-bottom: 1px solid var(--v38-border);
}

.v38-focus-head {
    margin-bottom: 8px;
}

.v38-focus-title p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v38-action-bar {
    border: 1px solid var(--v38-border);
    border-radius: 12px;
    background: var(--v38-soft);
    padding: 6px;
}

/* توازن مركز المتابعة */
.v38-work-center {
    display: grid;
    grid-template-columns: 1.45fr .86fr .72fr .98fr;
    gap: 8px;
}

.v38-priority-card,
.v38-ready-card,
.v38-total-card,
.v38-small-metrics {
    border: 1px solid var(--v38-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

.v38-priority-card {
    background: var(--v38-warn-bg);
    border-color: var(--v38-warn-border);
}

.v38-priority-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.v38-priority-head span {
    display: block;
    color: #8a5a00;
    font-size: 11.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v38-priority-head h4 {
    margin: 0;
    color: var(--v38-text);
    font-size: 12.8px;
    line-height: 1.35;
}

.v38-priority-head strong {
    color: #8a5a00;
    font-size: 25px;
    line-height: 1;
}

.v38-priority-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.v38-priority-items a {
    min-height: 52px;
    border: 1px solid var(--v38-warn-border);
    border-radius: 12px;
    background: #fff8ed;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v38-priority-items span,
.v38-small-metrics span,
.v38-ready-card > span,
.v38-total-card > span {
    color: var(--v38-muted);
    font-size: 11.5px;
}

.v38-priority-items strong {
    color: #8a5a00;
    font-size: 19px;
    line-height: 1;
}

.v38-ready-card {
    background: var(--v38-ready-bg);
    border-color: var(--v38-ready-border);
    display: grid;
    align-content: center;
    gap: 6px;
}

.v38-ready-card strong {
    color: var(--success);
    font-size: 29px;
    line-height: 1;
}

.v38-total-card {
    display: grid;
    align-content: center;
    gap: 6px;
    background: #fbfdfe;
}

.v38-total-card strong {
    color: var(--primary-dark);
    font-size: 23px;
    line-height: 1;
}

.v38-small-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: var(--v38-soft);
}

.v38-summary-title {
    border-bottom: 1px solid var(--v38-border);
    padding-bottom: 5px;
    margin-bottom: 1px;
}

.v38-summary-title span {
    display: block;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 1px;
}

.v38-summary-title p {
    margin: 0;
    color: var(--v38-muted);
    font-size: 11px;
    line-height: 1.4;
}

.v38-small-metrics a {
    min-height: 34px;
    border: 1px solid var(--v38-border);
    border-radius: 10px;
    background: #fff;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v38-small-metrics strong {
    color: var(--primary-dark);
    font-size: 15px;
}

/* مسار العمل */
.v38-flowline {
    min-height: 36px;
    padding: 7px 0;
    border-bottom: 1px solid var(--v38-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.v38-flowline span {
    min-height: 23px;
    border: 1px solid var(--v38-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v38-muted);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    font-size: 11.4px;
}

.v38-flowline i {
    width: 28px;
    height: 1px;
    background: var(--v38-border);
}

/* جدول المقارنة */
.v38-stages-panel {
    padding-top: 8px;
}

.v38-panel-head {
    margin-bottom: 7px;
}

.v38-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v38-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v38-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v38-border);
    padding: 6px 8px;
    text-align: right;
    font-size: 11.3px;
    font-weight: 500;
    white-space: nowrap;
}

.v38-table td {
    padding: 6.5px 8px;
    border-bottom: 1px solid var(--v38-border);
    color: var(--v38-text);
    font-size: 12.3px;
    font-weight: 400;
    line-height: 1.42;
    vertical-align: middle;
}

.v38-table tbody tr:hover td,
.v38-table tbody tr.is-selected td {
    background: #fbfdfe;
}

.v38-table tbody tr.is-empty td {
    color: #6d7d84;
}

.v38-table .col-order {
    width: 54px;
}

.v38-table .col-stage {
    width: 31%;
}

.v38-table .col-action {
    width: 105px;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.stage-cell strong {
    display: block;
    color: var(--v38-text);
    font-size: 12.8px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v38-muted);
    font-size: 11.3px;
    line-height: 1.4;
}

.v38-chip,
.v38-table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v38-table-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v38-table-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v38-empty-stage-tabs {
    grid-column: 1 / -1;
    min-height: 48px;
    border: 1px dashed var(--v38-border);
    border-radius: 12px;
    color: var(--v38-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1220px) {
    .v38-hero,
    .v38-focus-head,
    .v38-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v38-system-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v38-stage-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v38-work-center {
        grid-template-columns: 1fr 1fr;
    }

    .v38-small-metrics {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v38-summary-title {
        grid-column: 1 / -1;
    }

    .v38-table-wrap {
        overflow-x: auto;
    }

    .v38-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v38-dashboard) .page,
    body:has(.v38-dashboard) .container,
    body:has(.v38-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v38-system-strip,
    .v38-stage-tabs,
    .v38-work-center,
    .v38-priority-items,
    .v38-small-metrics {
        grid-template-columns: 1fr;
    }

    .v38-flowline {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .v38-flowline i {
        display: none;
    }
}


/* ===== V39 Dashboard: final locked version ===== */

body:has(.v39-dashboard) {
    font-weight: 400;
}

body:has(.v39-dashboard) strong,
body:has(.v39-dashboard) b,
body:has(.v39-dashboard) h1,
body:has(.v39-dashboard) h2,
body:has(.v39-dashboard) h3,
body:has(.v39-dashboard) h4 {
    font-weight: 500;
}

body:has(.v39-dashboard) .page,
body:has(.v39-dashboard) .container,
body:has(.v39-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v39-dashboard {
    --v39-border: #dce7eb;
    --v39-soft: #f7fafb;
    --v39-text: #253842;
    --v39-muted: #7c8b92;
    --v39-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
    --v39-warn-bg: #fffaf2;
    --v39-warn-border: #ead8b1;
    --v39-ready-bg: #f8fcfa;
    --v39-ready-border: #d5eadf;
}

.v39-board {
    background: #fff;
    border: 1px solid var(--v39-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v39-shadow);
}

.v39-hero,
.v39-focus-head,
.v39-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v39-hero {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v39-border);
}

.v39-hero span,
.v39-focus-title > span {
    display: block;
    color: var(--primary);
    font-size: 10.7px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v39-hero h2,
.v39-focus-title h3 {
    margin: 0;
    color: var(--v39-text);
    font-size: 22px;
    line-height: 1.45;
}

.v39-hero p,
.v39-focus-title p {
    margin: 4px 0 0;
    color: var(--v39-muted);
    font-size: 12.3px;
    line-height: 1.62;
}

.v39-hero-actions,
.v39-action-bar,
.v39-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v39-hero-actions a,
.v39-action-bar a,
.v39-panel-head a,
.v39-action-link,
.v39-ready-card a,
.v39-total-card a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v39-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v39-hero-actions .is-primary,
.v39-action-bar .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ملخص النظام */
.v39-system-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v39-border);
}

.v39-system-strip div {
    min-height: 43px;
    border: 1px solid var(--v39-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v39-system-strip span {
    color: var(--v39-muted);
    font-size: 11.2px;
}

.v39-system-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

/* اختيار المرحلة */
.v39-stage-picker {
    padding: 8px 0;
    border-bottom: 1px solid var(--v39-border);
}

.v39-section-head {
    margin-bottom: 6px;
}

.v39-section-head h3,
.v39-panel-head h3 {
    margin: 0;
    color: var(--v39-text);
    font-size: 15.4px;
    line-height: 1.35;
}

.v39-section-head p,
.v39-panel-head p {
    margin: 2px 0 0;
    color: var(--v39-muted);
    font-size: 11.7px;
}

.v39-stage-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.v39-stage-tabs a {
    min-height: 52px;
    border: 1px solid var(--v39-border);
    border-radius: 13px;
    background: #fbfdfe;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 7px;
}

.v39-stage-tabs a.active {
    background: #f7fcfd;
    border-color: rgba(47, 113, 136, .48);
    box-shadow: inset 0 0 0 1px rgba(47, 113, 136, .13);
}

.v39-stage-tabs a.is-empty {
    opacity: .76;
}

.v39-stage-tabs b {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--v39-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.8px;
}

.v39-stage-tabs span {
    color: var(--v39-text);
    font-size: 12.3px;
    font-weight: 500;
}

.v39-stage-tabs em {
    color: var(--v39-muted);
    font-size: 11.3px;
    font-style: normal;
    white-space: nowrap;
}

/* مركز المتابعة */
.v39-focus {
    padding: 9px 0;
    border-bottom: 1px solid var(--v39-border);
}

.v39-focus-head {
    margin-bottom: 8px;
}

.v39-focus-title p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v39-action-bar {
    border: 1px solid var(--v39-border);
    border-radius: 12px;
    background: var(--v39-soft);
    padding: 6px;
}

/* مركز العمل المتوازن */
.v39-work-center {
    display: grid;
    grid-template-columns: 1.45fr .86fr .72fr .98fr;
    gap: 8px;
    align-items: stretch;
}

.v39-priority-card,
.v39-ready-card,
.v39-total-card,
.v39-small-metrics {
    min-height: 132px;
    border: 1px solid var(--v39-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

.v39-priority-card {
    background: var(--v39-warn-bg);
    border-color: var(--v39-warn-border);
}

.v39-priority-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.v39-priority-head span {
    display: block;
    color: #8a5a00;
    font-size: 11.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v39-priority-head h4 {
    margin: 0;
    color: var(--v39-text);
    font-size: 12.8px;
    line-height: 1.35;
}

.v39-priority-head strong {
    color: #8a5a00;
    font-size: 25px;
    line-height: 1;
}

.v39-priority-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.v39-priority-items a {
    min-height: 50px;
    border: 1px solid var(--v39-warn-border);
    border-radius: 12px;
    background: #fff8ed;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v39-priority-items span,
.v39-small-metrics span,
.v39-ready-card > span,
.v39-total-card > span {
    color: var(--v39-muted);
    font-size: 11.5px;
}

.v39-priority-items strong {
    color: #8a5a00;
    font-size: 19px;
    line-height: 1;
}

.v39-ready-card {
    background: var(--v39-ready-bg);
    border-color: var(--v39-ready-border);
    display: grid;
    align-content: center;
    gap: 6px;
}

.v39-ready-card strong {
    color: var(--success);
    font-size: 29px;
    line-height: 1;
}

.v39-total-card {
    display: grid;
    align-content: center;
    gap: 6px;
    background: #fbfdfe;
}

.v39-total-card strong {
    color: var(--primary-dark);
    font-size: 23px;
    line-height: 1;
}

.v39-small-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: var(--v39-soft);
}

.v39-summary-title {
    border-bottom: 1px solid var(--v39-border);
    padding-bottom: 5px;
    margin-bottom: 1px;
}

.v39-summary-title span {
    display: block;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 1px;
}

.v39-summary-title p {
    margin: 0;
    color: var(--v39-muted);
    font-size: 11px;
    line-height: 1.4;
}

.v39-small-metrics a {
    min-height: 32px;
    border: 1px solid var(--v39-border);
    border-radius: 10px;
    background: #fff;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v39-small-metrics strong {
    color: var(--primary-dark);
    font-size: 15px;
}

/* مسار العمل */
.v39-flowline {
    min-height: 35px;
    padding: 7px 0;
    border-bottom: 1px solid var(--v39-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.v39-flowline span {
    min-height: 23px;
    border: 1px solid var(--v39-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v39-muted);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    font-size: 11.4px;
}

.v39-flowline i {
    width: 28px;
    height: 1px;
    background: var(--v39-border);
}

/* جدول المقارنة */
.v39-stages-panel {
    padding-top: 8px;
}

.v39-panel-head {
    margin-bottom: 7px;
}

.v39-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v39-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v39-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v39-border);
    padding: 6px 8px;
    text-align: right;
    font-size: 11.3px;
    font-weight: 500;
    white-space: nowrap;
}

.v39-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--v39-border);
    color: var(--v39-text);
    font-size: 12.2px;
    font-weight: 400;
    line-height: 1.4;
    vertical-align: middle;
}

.v39-table tbody tr:hover td,
.v39-table tbody tr.is-selected td {
    background: #fbfdfe;
}

.v39-table tbody tr.is-empty td {
    color: #6d7d84;
}

.v39-table .col-order {
    width: 54px;
}

.v39-table .col-stage {
    width: 31%;
}

.v39-table .col-action {
    width: 105px;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.stage-cell strong {
    display: block;
    color: var(--v39-text);
    font-size: 12.7px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span,
.period-cell span {
    display: block;
    color: var(--v39-muted);
    font-size: 11.2px;
    line-height: 1.38;
}

.v39-chip,
.v39-table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v39-table-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v39-table-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v39-empty-stage-tabs {
    grid-column: 1 / -1;
    min-height: 48px;
    border: 1px dashed var(--v39-border);
    border-radius: 12px;
    color: var(--v39-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1220px) {
    .v39-hero,
    .v39-focus-head,
    .v39-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v39-system-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v39-stage-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v39-work-center {
        grid-template-columns: 1fr 1fr;
    }

    .v39-small-metrics {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v39-summary-title {
        grid-column: 1 / -1;
    }

    .v39-table-wrap {
        overflow-x: auto;
    }

    .v39-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v39-dashboard) .page,
    body:has(.v39-dashboard) .container,
    body:has(.v39-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v39-system-strip,
    .v39-stage-tabs,
    .v39-work-center,
    .v39-priority-items,
    .v39-small-metrics {
        grid-template-columns: 1fr;
    }

    .v39-flowline {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .v39-flowline i {
        display: none;
    }
}


/* ===== V40 Dashboard: final micro-fixes for priority card and period column ===== */

/* تفعيل قالب V40 مع الاحتفاظ بنفس هوية V39 */
body:has(.v40-dashboard) {
    font-weight: 400;
}

body:has(.v40-dashboard) strong,
body:has(.v40-dashboard) b,
body:has(.v40-dashboard) h1,
body:has(.v40-dashboard) h2,
body:has(.v40-dashboard) h3,
body:has(.v40-dashboard) h4 {
    font-weight: 500;
}

body:has(.v40-dashboard) .page,
body:has(.v40-dashboard) .container,
body:has(.v40-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v40-dashboard {
    --v40-border: #dce7eb;
    --v40-soft: #f7fafb;
    --v40-text: #253842;
    --v40-muted: #7c8b92;
    --v40-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
    --v40-warn-bg: #fffaf2;
    --v40-warn-border: #ead8b1;
    --v40-ready-bg: #f8fcfa;
    --v40-ready-border: #d5eadf;
}

/* نسخ قواعد V39 الأساسية إلى V40 */
.v40-board {
    background: #fff;
    border: 1px solid var(--v40-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v40-shadow);
}

.v40-hero,
.v40-focus-head,
.v40-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v40-hero {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v40-border);
}

.v40-hero span,
.v40-focus-title > span {
    display: block;
    color: var(--primary);
    font-size: 10.7px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v40-hero h2,
.v40-focus-title h3 {
    margin: 0;
    color: var(--v40-text);
    font-size: 22px;
    line-height: 1.45;
}

.v40-hero p,
.v40-focus-title p {
    margin: 4px 0 0;
    color: var(--v40-muted);
    font-size: 12.3px;
    line-height: 1.62;
}

.v40-hero-actions,
.v40-action-bar,
.v40-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v40-hero-actions a,
.v40-action-bar a,
.v40-panel-head a,
.v40-action-link,
.v40-ready-card a,
.v40-total-card a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v40-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v40-hero-actions .is-primary,
.v40-action-bar .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v40-system-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v40-border);
}

.v40-system-strip div {
    min-height: 43px;
    border: 1px solid var(--v40-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v40-system-strip span {
    color: var(--v40-muted);
    font-size: 11.2px;
}

.v40-system-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v40-stage-picker {
    padding: 8px 0;
    border-bottom: 1px solid var(--v40-border);
}

.v40-section-head {
    margin-bottom: 6px;
}

.v40-section-head h3,
.v40-panel-head h3 {
    margin: 0;
    color: var(--v40-text);
    font-size: 15.4px;
    line-height: 1.35;
}

.v40-section-head p,
.v40-panel-head p {
    margin: 2px 0 0;
    color: var(--v40-muted);
    font-size: 11.7px;
}

.v40-stage-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.v40-stage-tabs a {
    min-height: 52px;
    border: 1px solid var(--v40-border);
    border-radius: 13px;
    background: #fbfdfe;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 7px;
}

.v40-stage-tabs a.active {
    background: #f7fcfd;
    border-color: rgba(47, 113, 136, .48);
    box-shadow: inset 0 0 0 1px rgba(47, 113, 136, .13);
}

.v40-stage-tabs a.is-empty {
    opacity: .76;
}

.v40-stage-tabs b {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--v40-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.8px;
}

.v40-stage-tabs span {
    color: var(--v40-text);
    font-size: 12.3px;
    font-weight: 500;
}

.v40-stage-tabs em {
    color: var(--v40-muted);
    font-size: 11.3px;
    font-style: normal;
    white-space: nowrap;
}

.v40-focus {
    padding: 9px 0;
    border-bottom: 1px solid var(--v40-border);
}

.v40-focus-head {
    margin-bottom: 8px;
}

.v40-focus-title p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v40-action-bar {
    border: 1px solid var(--v40-border);
    border-radius: 12px;
    background: var(--v40-soft);
    padding: 6px;
}

.v40-work-center {
    display: grid;
    grid-template-columns: 1.45fr .86fr .72fr .98fr;
    gap: 8px;
    align-items: stretch;
}

.v40-priority-card,
.v40-ready-card,
.v40-total-card,
.v40-small-metrics {
    border: 1px solid var(--v40-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

/* إصلاح 1: بطاقة الأولوية لا تحتاج فراغًا طويلًا */
.v40-priority-card {
    min-height: 118px;
    background: var(--v40-warn-bg);
    border-color: var(--v40-warn-border);
}

.v40-ready-card,
.v40-total-card,
.v40-small-metrics {
    min-height: 118px;
}

.v40-priority-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.v40-priority-head span {
    display: block;
    color: #8a5a00;
    font-size: 11.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v40-priority-head h4 {
    margin: 0;
    color: var(--v40-text);
    font-size: 12.8px;
    line-height: 1.35;
}

.v40-priority-head strong {
    color: #8a5a00;
    font-size: 25px;
    line-height: 1;
}

.v40-priority-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.v40-priority-items a {
    min-height: 48px;
    border: 1px solid var(--v40-warn-border);
    border-radius: 12px;
    background: #fff8ed;
    padding: 6px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v40-priority-items span,
.v40-small-metrics span,
.v40-ready-card > span,
.v40-total-card > span {
    color: var(--v40-muted);
    font-size: 11.5px;
}

.v40-priority-items strong {
    color: #8a5a00;
    font-size: 19px;
    line-height: 1;
}

.v40-ready-card {
    background: var(--v40-ready-bg);
    border-color: var(--v40-ready-border);
    display: grid;
    align-content: center;
    gap: 6px;
}

.v40-ready-card strong {
    color: var(--success);
    font-size: 29px;
    line-height: 1;
}

.v40-total-card {
    display: grid;
    align-content: center;
    gap: 6px;
    background: #fbfdfe;
}

.v40-total-card strong {
    color: var(--primary-dark);
    font-size: 23px;
    line-height: 1;
}

.v40-small-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: var(--v40-soft);
}

.v40-summary-title {
    border-bottom: 1px solid var(--v40-border);
    padding-bottom: 5px;
    margin-bottom: 1px;
}

.v40-summary-title span {
    display: block;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 1px;
}

.v40-summary-title p {
    margin: 0;
    color: var(--v40-muted);
    font-size: 11px;
    line-height: 1.4;
}

.v40-small-metrics a {
    min-height: 32px;
    border: 1px solid var(--v40-border);
    border-radius: 10px;
    background: #fff;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v40-small-metrics strong {
    color: var(--primary-dark);
    font-size: 15px;
}

.v40-flowline {
    min-height: 35px;
    padding: 7px 0;
    border-bottom: 1px solid var(--v40-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.v40-flowline span {
    min-height: 23px;
    border: 1px solid var(--v40-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v40-muted);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    font-size: 11.4px;
}

.v40-flowline i {
    width: 28px;
    height: 1px;
    background: var(--v40-border);
}

/* جدول المقارنة */
.v40-stages-panel {
    padding-top: 8px;
}

.v40-panel-head {
    margin-bottom: 7px;
}

.v40-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v40-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v40-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v40-border);
    padding: 6px 8px;
    text-align: right;
    font-size: 11.3px;
    font-weight: 500;
    white-space: nowrap;
}

.v40-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--v40-border);
    color: var(--v40-text);
    font-size: 12.2px;
    font-weight: 400;
    line-height: 1.4;
    vertical-align: middle;
}

/* إصلاح 2: منع اختلاط رقم الطلبات مع تاريخ الفترة */
.v40-table th:nth-child(5),
.v40-table td:nth-child(5),
.v40-table th:nth-child(6),
.v40-table td:nth-child(6),
.v40-table th:nth-child(7),
.v40-table td:nth-child(7),
.v40-table th:nth-child(8),
.v40-table td:nth-child(8) {
    text-align: center;
}

.v40-table th:nth-child(4),
.v40-table td:nth-child(4) {
    width: 190px;
    text-align: center;
}

.v40-table .period-cell {
    direction: rtl;
    text-align: center;
}

.v40-table .period-text {
    display: inline-block;
    direction: rtl;
    unicode-bidi: isolate;
    white-space: nowrap;
    color: var(--v40-muted);
    font-size: 11.2px;
    padding-inline: 10px;
}

.v40-table tbody tr:hover td,
.v40-table tbody tr.is-selected td {
    background: #fbfdfe;
}

.v40-table tbody tr.is-empty td {
    color: #6d7d84;
}

.v40-table .col-order {
    width: 54px;
}

.v40-table .col-stage {
    width: 31%;
}

.v40-table .col-action {
    width: 105px;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.stage-cell strong {
    display: block;
    color: var(--v40-text);
    font-size: 12.7px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span {
    display: block;
    color: var(--v40-muted);
    font-size: 11.2px;
    line-height: 1.38;
}

.v40-chip,
.v40-table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v40-table-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v40-table-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v40-empty-stage-tabs {
    grid-column: 1 / -1;
    min-height: 48px;
    border: 1px dashed var(--v40-border);
    border-radius: 12px;
    color: var(--v40-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1220px) {
    .v40-hero,
    .v40-focus-head,
    .v40-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v40-system-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v40-stage-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v40-work-center {
        grid-template-columns: 1fr 1fr;
    }

    .v40-small-metrics {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v40-summary-title {
        grid-column: 1 / -1;
    }

    .v40-table-wrap {
        overflow-x: auto;
    }

    .v40-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v40-dashboard) .page,
    body:has(.v40-dashboard) .container,
    body:has(.v40-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v40-system-strip,
    .v40-stage-tabs,
    .v40-work-center,
    .v40-priority-items,
    .v40-small-metrics {
        grid-template-columns: 1fr;
    }

    .v40-flowline {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .v40-flowline i {
        display: none;
    }
}


/* ===== V41 Dashboard: priority card compact fix ===== */

body:has(.v41-dashboard) {
    font-weight: 400;
}

body:has(.v41-dashboard) strong,
body:has(.v41-dashboard) b,
body:has(.v41-dashboard) h1,
body:has(.v41-dashboard) h2,
body:has(.v41-dashboard) h3,
body:has(.v41-dashboard) h4 {
    font-weight: 500;
}

body:has(.v41-dashboard) .page,
body:has(.v41-dashboard) .container,
body:has(.v41-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v41-dashboard {
    --v41-border: #dce7eb;
    --v41-soft: #f7fafb;
    --v41-text: #253842;
    --v41-muted: #7c8b92;
    --v41-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
    --v41-warn-bg: #fffaf2;
    --v41-warn-border: #ead8b1;
    --v41-ready-bg: #f8fcfa;
    --v41-ready-border: #d5eadf;
}

.v41-board {
    background: #fff;
    border: 1px solid var(--v41-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v41-shadow);
}

.v41-hero,
.v41-focus-head,
.v41-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v41-hero {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v41-border);
}

.v41-hero span,
.v41-focus-title > span {
    display: block;
    color: var(--primary);
    font-size: 10.7px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v41-hero h2,
.v41-focus-title h3 {
    margin: 0;
    color: var(--v41-text);
    font-size: 22px;
    line-height: 1.45;
}

.v41-hero p,
.v41-focus-title p {
    margin: 4px 0 0;
    color: var(--v41-muted);
    font-size: 12.3px;
    line-height: 1.62;
}

.v41-hero-actions,
.v41-action-bar,
.v41-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v41-hero-actions a,
.v41-action-bar a,
.v41-panel-head a,
.v41-action-link,
.v41-ready-card a,
.v41-total-card a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v41-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v41-hero-actions .is-primary,
.v41-action-bar .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v41-system-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v41-border);
}

.v41-system-strip div {
    min-height: 43px;
    border: 1px solid var(--v41-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v41-system-strip span {
    color: var(--v41-muted);
    font-size: 11.2px;
}

.v41-system-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v41-stage-picker {
    padding: 8px 0;
    border-bottom: 1px solid var(--v41-border);
}

.v41-section-head {
    margin-bottom: 6px;
}

.v41-section-head h3,
.v41-panel-head h3 {
    margin: 0;
    color: var(--v41-text);
    font-size: 15.4px;
    line-height: 1.35;
}

.v41-section-head p,
.v41-panel-head p {
    margin: 2px 0 0;
    color: var(--v41-muted);
    font-size: 11.7px;
}

.v41-stage-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.v41-stage-tabs a {
    min-height: 52px;
    border: 1px solid var(--v41-border);
    border-radius: 13px;
    background: #fbfdfe;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 7px;
}

.v41-stage-tabs a.active {
    background: #f7fcfd;
    border-color: rgba(47, 113, 136, .48);
    box-shadow: inset 0 0 0 1px rgba(47, 113, 136, .13);
}

.v41-stage-tabs a.is-empty {
    opacity: .76;
}

.v41-stage-tabs b {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--v41-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.8px;
}

.v41-stage-tabs span {
    color: var(--v41-text);
    font-size: 12.3px;
    font-weight: 500;
}

.v41-stage-tabs em {
    color: var(--v41-muted);
    font-size: 11.3px;
    font-style: normal;
    white-space: nowrap;
}

.v41-focus {
    padding: 9px 0;
    border-bottom: 1px solid var(--v41-border);
}

.v41-focus-head {
    margin-bottom: 8px;
}

.v41-focus-title p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v41-action-bar {
    border: 1px solid var(--v41-border);
    border-radius: 12px;
    background: var(--v41-soft);
    padding: 6px;
}

.v41-work-center {
    display: grid;
    grid-template-columns: 1.35fr .82fr .70fr 1.05fr;
    gap: 8px;
    align-items: stretch;
}

.v41-priority-card,
.v41-ready-card,
.v41-total-card,
.v41-small-metrics {
    border: 1px solid var(--v41-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

/* الإصلاح الأساسي: لا يوجد فراغ ميت داخل بطاقة الأولوية */
.v41-priority-card {
    min-height: unset;
    background: var(--v41-warn-bg);
    border-color: var(--v41-warn-border);
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 7px;
}

.v41-ready-card,
.v41-total-card,
.v41-small-metrics {
    min-height: 116px;
}

.v41-priority-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 10px;
    margin-bottom: 0;
}

.v41-priority-head span {
    display: block;
    color: #8a5a00;
    font-size: 11.7px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v41-priority-head h4 {
    margin: 0;
    color: var(--v41-text);
    font-size: 12.5px;
    line-height: 1.35;
}

.v41-priority-head strong {
    color: #8a5a00;
    font-size: 24px;
    line-height: 1;
}

.v41-priority-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.v41-priority-items a {
    min-height: 42px;
    border: 1px solid var(--v41-warn-border);
    border-radius: 12px;
    background: #fff8ed;
    padding: 5px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v41-priority-items span,
.v41-small-metrics span,
.v41-ready-card > span,
.v41-total-card > span {
    color: var(--v41-muted);
    font-size: 11.4px;
}

.v41-priority-items strong {
    color: #8a5a00;
    font-size: 18px;
    line-height: 1;
}

.v41-ready-card {
    background: var(--v41-ready-bg);
    border-color: var(--v41-ready-border);
    display: grid;
    align-content: center;
    gap: 6px;
}

.v41-ready-card strong {
    color: var(--success);
    font-size: 29px;
    line-height: 1;
}

.v41-total-card {
    display: grid;
    align-content: center;
    gap: 6px;
    background: #fbfdfe;
}

.v41-total-card strong {
    color: var(--primary-dark);
    font-size: 23px;
    line-height: 1;
}

.v41-small-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: var(--v41-soft);
}

.v41-summary-title {
    border-bottom: 1px solid var(--v41-border);
    padding-bottom: 5px;
    margin-bottom: 1px;
}

.v41-summary-title span {
    display: block;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 1px;
}

.v41-summary-title p {
    margin: 0;
    color: var(--v41-muted);
    font-size: 11px;
    line-height: 1.4;
}

.v41-small-metrics a {
    min-height: 32px;
    border: 1px solid var(--v41-border);
    border-radius: 10px;
    background: #fff;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v41-small-metrics strong {
    color: var(--primary-dark);
    font-size: 15px;
}

.v41-flowline {
    min-height: 35px;
    padding: 7px 0;
    border-bottom: 1px solid var(--v41-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.v41-flowline span {
    min-height: 23px;
    border: 1px solid var(--v41-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v41-muted);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    font-size: 11.4px;
}

.v41-flowline i {
    width: 28px;
    height: 1px;
    background: var(--v41-border);
}

.v41-stages-panel {
    padding-top: 8px;
}

.v41-panel-head {
    margin-bottom: 7px;
}

.v41-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v41-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v41-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v41-border);
    padding: 6px 8px;
    text-align: right;
    font-size: 11.3px;
    font-weight: 500;
    white-space: nowrap;
}

.v41-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--v41-border);
    color: var(--v41-text);
    font-size: 12.2px;
    font-weight: 400;
    line-height: 1.4;
    vertical-align: middle;
}

.v41-table th:nth-child(5),
.v41-table td:nth-child(5),
.v41-table th:nth-child(6),
.v41-table td:nth-child(6),
.v41-table th:nth-child(7),
.v41-table td:nth-child(7),
.v41-table th:nth-child(8),
.v41-table td:nth-child(8) {
    text-align: center;
}

.v41-table th:nth-child(4),
.v41-table td:nth-child(4) {
    width: 190px;
    text-align: center;
}

.v41-table .period-cell {
    direction: rtl;
    text-align: center;
}

.v41-table .period-text {
    display: inline-block;
    direction: rtl;
    unicode-bidi: isolate;
    white-space: nowrap;
    color: var(--v41-muted);
    font-size: 11.2px;
    padding-inline: 10px;
}

.v41-table tbody tr:hover td,
.v41-table tbody tr.is-selected td {
    background: #fbfdfe;
}

.v41-table tbody tr.is-empty td {
    color: #6d7d84;
}

.v41-table .col-order {
    width: 54px;
}

.v41-table .col-stage {
    width: 31%;
}

.v41-table .col-action {
    width: 105px;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.stage-cell strong {
    display: block;
    color: var(--v41-text);
    font-size: 12.7px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span {
    display: block;
    color: var(--v41-muted);
    font-size: 11.2px;
    line-height: 1.38;
}

.v41-chip,
.v41-table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v41-table-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v41-table-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v41-empty-stage-tabs {
    grid-column: 1 / -1;
    min-height: 48px;
    border: 1px dashed var(--v41-border);
    border-radius: 12px;
    color: var(--v41-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1220px) {
    .v41-hero,
    .v41-focus-head,
    .v41-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v41-system-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v41-stage-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v41-work-center {
        grid-template-columns: 1fr 1fr;
    }

    .v41-small-metrics {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v41-summary-title {
        grid-column: 1 / -1;
    }

    .v41-table-wrap {
        overflow-x: auto;
    }

    .v41-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v41-dashboard) .page,
    body:has(.v41-dashboard) .container,
    body:has(.v41-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v41-system-strip,
    .v41-stage-tabs,
    .v41-work-center,
    .v41-priority-items,
    .v41-small-metrics {
        grid-template-columns: 1fr;
    }

    .v41-flowline {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .v41-flowline i {
        display: none;
    }
}


/* ===== V42 Dashboard: priority card compact fix ===== */

body:has(.v42-dashboard) {
    font-weight: 400;
}

body:has(.v42-dashboard) strong,
body:has(.v42-dashboard) b,
body:has(.v42-dashboard) h1,
body:has(.v42-dashboard) h2,
body:has(.v42-dashboard) h3,
body:has(.v42-dashboard) h4 {
    font-weight: 500;
}

body:has(.v42-dashboard) .page,
body:has(.v42-dashboard) .container,
body:has(.v42-dashboard) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v42-dashboard {
    --v42-border: #dce7eb;
    --v42-soft: #f7fafb;
    --v42-text: #253842;
    --v42-muted: #7c8b92;
    --v42-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
    --v42-warn-bg: #fffaf2;
    --v42-warn-border: #ead8b1;
    --v42-ready-bg: #f8fcfa;
    --v42-ready-border: #d5eadf;
}

.v42-board {
    background: #fff;
    border: 1px solid var(--v42-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v42-shadow);
}

.v42-hero,
.v42-focus-head,
.v42-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v42-hero {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v42-border);
}

.v42-hero span,
.v42-focus-title > span {
    display: block;
    color: var(--primary);
    font-size: 10.7px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v42-hero h2,
.v42-focus-title h3 {
    margin: 0;
    color: var(--v42-text);
    font-size: 22px;
    line-height: 1.45;
}

.v42-hero p,
.v42-focus-title p {
    margin: 4px 0 0;
    color: var(--v42-muted);
    font-size: 12.3px;
    line-height: 1.62;
}

.v42-hero-actions,
.v42-action-bar,
.v42-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v42-hero-actions a,
.v42-action-bar a,
.v42-panel-head a,
.v42-action-link,
.v42-ready-card a,
.v42-total-card a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v42-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v42-hero-actions .is-primary,
.v42-action-bar .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v42-system-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v42-border);
}

.v42-system-strip div {
    min-height: 43px;
    border: 1px solid var(--v42-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v42-system-strip span {
    color: var(--v42-muted);
    font-size: 11.2px;
}

.v42-system-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v42-stage-picker {
    padding: 8px 0;
    border-bottom: 1px solid var(--v42-border);
}

.v42-section-head {
    margin-bottom: 6px;
}

.v42-section-head h3,
.v42-panel-head h3 {
    margin: 0;
    color: var(--v42-text);
    font-size: 15.4px;
    line-height: 1.35;
}

.v42-section-head p,
.v42-panel-head p {
    margin: 2px 0 0;
    color: var(--v42-muted);
    font-size: 11.7px;
}

.v42-stage-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.v42-stage-tabs a {
    min-height: 52px;
    border: 1px solid var(--v42-border);
    border-radius: 13px;
    background: #fbfdfe;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 7px;
}

.v42-stage-tabs a.active {
    background: #f7fcfd;
    border-color: rgba(47, 113, 136, .48);
    box-shadow: inset 0 0 0 1px rgba(47, 113, 136, .13);
}

.v42-stage-tabs a.is-empty {
    opacity: .76;
}

.v42-stage-tabs b {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--v42-border);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.8px;
}

.v42-stage-tabs span {
    color: var(--v42-text);
    font-size: 12.3px;
    font-weight: 500;
}

.v42-stage-tabs em {
    color: var(--v42-muted);
    font-size: 11.3px;
    font-style: normal;
    white-space: nowrap;
}

.v42-focus {
    padding: 9px 0;
    border-bottom: 1px solid var(--v42-border);
}

.v42-focus-head {
    margin-bottom: 8px;
}

.v42-focus-title p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.v42-action-bar {
    border: 1px solid var(--v42-border);
    border-radius: 12px;
    background: var(--v42-soft);
    padding: 6px;
}

.v42-work-center {
    display: grid;
    grid-template-columns: 1.35fr .82fr .70fr 1.05fr;
    gap: 8px;
    align-items: stretch;
}

.v42-priority-card,
.v42-ready-card,
.v42-total-card,
.v42-small-metrics {
    border: 1px solid var(--v42-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

/* الإصلاح الأساسي: لا يوجد فراغ ميت داخل بطاقة الأولوية */
.v42-priority-card {
    min-height: unset;
    background: var(--v42-warn-bg);
    border-color: var(--v42-warn-border);
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 7px;
}

.v42-ready-card,
.v42-total-card,
.v42-small-metrics {
    min-height: 116px;
}

.v42-priority-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 10px;
    margin-bottom: 0;
}

.v42-priority-head span {
    display: block;
    color: #8a5a00;
    font-size: 11.7px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v42-priority-head h4 {
    margin: 0;
    color: var(--v42-text);
    font-size: 12.5px;
    line-height: 1.35;
}

.v42-priority-head strong {
    color: #8a5a00;
    font-size: 24px;
    line-height: 1;
}

.v42-priority-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.v42-priority-items a {
    min-height: 42px;
    border: 1px solid var(--v42-warn-border);
    border-radius: 12px;
    background: #fff8ed;
    padding: 5px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v42-priority-items span,
.v42-small-metrics span,
.v42-ready-card > span,
.v42-total-card > span {
    color: var(--v42-muted);
    font-size: 11.4px;
}

.v42-priority-items strong {
    color: #8a5a00;
    font-size: 18px;
    line-height: 1;
}

.v42-ready-card {
    background: var(--v42-ready-bg);
    border-color: var(--v42-ready-border);
    display: grid;
    align-content: center;
    gap: 6px;
}

.v42-ready-card strong {
    color: var(--success);
    font-size: 29px;
    line-height: 1;
}

.v42-total-card {
    display: grid;
    align-content: center;
    gap: 6px;
    background: #fbfdfe;
}

.v42-total-card strong {
    color: var(--primary-dark);
    font-size: 23px;
    line-height: 1;
}

.v42-small-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: var(--v42-soft);
}

.v42-summary-title {
    border-bottom: 1px solid var(--v42-border);
    padding-bottom: 5px;
    margin-bottom: 1px;
}

.v42-summary-title span {
    display: block;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 1px;
}

.v42-summary-title p {
    margin: 0;
    color: var(--v42-muted);
    font-size: 11px;
    line-height: 1.4;
}

.v42-small-metrics a {
    min-height: 32px;
    border: 1px solid var(--v42-border);
    border-radius: 10px;
    background: #fff;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v42-small-metrics strong {
    color: var(--primary-dark);
    font-size: 15px;
}

.v42-flowline {
    min-height: 35px;
    padding: 7px 0;
    border-bottom: 1px solid var(--v42-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.v42-flowline span {
    min-height: 23px;
    border: 1px solid var(--v42-border);
    border-radius: 999px;
    background: #fff;
    color: var(--v42-muted);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    font-size: 11.4px;
}

.v42-flowline i {
    width: 28px;
    height: 1px;
    background: var(--v42-border);
}

.v42-stages-panel {
    padding-top: 8px;
}

.v42-panel-head {
    margin-bottom: 7px;
}

.v42-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v42-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v42-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v42-border);
    padding: 6px 8px;
    text-align: right;
    font-size: 11.3px;
    font-weight: 500;
    white-space: nowrap;
}

.v42-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--v42-border);
    color: var(--v42-text);
    font-size: 12.2px;
    font-weight: 400;
    line-height: 1.4;
    vertical-align: middle;
}

.v42-table th:nth-child(5),
.v42-table td:nth-child(5),
.v42-table th:nth-child(6),
.v42-table td:nth-child(6),
.v42-table th:nth-child(7),
.v42-table td:nth-child(7),
.v42-table th:nth-child(8),
.v42-table td:nth-child(8) {
    text-align: center;
}

.v42-table th:nth-child(4),
.v42-table td:nth-child(4) {
    width: 190px;
    text-align: center;
}

.v42-table .period-cell {
    direction: rtl;
    text-align: center;
}

.v42-table .period-text {
    display: inline-block;
    direction: rtl;
    unicode-bidi: isolate;
    white-space: nowrap;
    color: var(--v42-muted);
    font-size: 11.2px;
    padding-inline: 10px;
}

.v42-table tbody tr:hover td,
.v42-table tbody tr.is-selected td {
    background: #fbfdfe;
}

.v42-table tbody tr.is-empty td {
    color: #6d7d84;
}

.v42-table .col-order {
    width: 54px;
}

.v42-table .col-stage {
    width: 31%;
}

.v42-table .col-action {
    width: 105px;
}

.num-cell {
    color: var(--primary-dark);
    font-weight: 500;
    text-align: center;
}

.stage-cell strong {
    display: block;
    color: var(--v42-text);
    font-size: 12.7px;
    font-weight: 500;
    margin-bottom: 1px;
}

.stage-cell span {
    display: block;
    color: var(--v42-muted);
    font-size: 11.2px;
    line-height: 1.38;
}

.v42-chip,
.v42-table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v42-table-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v42-table-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v42-empty-stage-tabs {
    grid-column: 1 / -1;
    min-height: 48px;
    border: 1px dashed var(--v42-border);
    border-radius: 12px;
    color: var(--v42-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1220px) {
    .v42-hero,
    .v42-focus-head,
    .v42-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v42-system-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v42-stage-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v42-work-center {
        grid-template-columns: 1fr 1fr;
    }

    .v42-small-metrics {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v42-summary-title {
        grid-column: 1 / -1;
    }

    .v42-table-wrap {
        overflow-x: auto;
    }

    .v42-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v42-dashboard) .page,
    body:has(.v42-dashboard) .container,
    body:has(.v42-dashboard) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v42-system-strip,
    .v42-stage-tabs,
    .v42-work-center,
    .v42-priority-items,
    .v42-small-metrics {
        grid-template-columns: 1fr;
    }

    .v42-flowline {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .v42-flowline i {
        display: none;
    }
}


/* ===== V42 Priority action button: use the remaining space instead of leaving it empty ===== */

.v42-priority-card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    align-content: stretch;
    gap: 7px;
    min-height: 116px;
}

.v42-priority-action {
    min-height: 32px;
    align-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v42-warn-border);
    border-radius: 10px;
    background: #fff8ed;
    color: #8a5a00;
    padding: 5px 9px;
    font-size: 11.8px;
    font-weight: 500;
}

.v42-priority-action:hover {
    background: #fff4de;
}

.v42-priority-items a {
    min-height: 42px;
}

@media (max-width: 720px) {
    .v42-priority-action {
        align-self: stretch;
    }
}


/* ===== V43 Applications: practical review and processing table ===== */

body:has(.v43-applications) {
    font-weight: 400;
}

body:has(.v43-applications) strong,
body:has(.v43-applications) b,
body:has(.v43-applications) h1,
body:has(.v43-applications) h2,
body:has(.v43-applications) h3,
body:has(.v43-applications) h4 {
    font-weight: 500;
}

body:has(.v43-applications) .page,
body:has(.v43-applications) .container,
body:has(.v43-applications) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v43-applications {
    --v43-border: #dce7eb;
    --v43-soft: #f7fafb;
    --v43-text: #253842;
    --v43-muted: #7c8b92;
    --v43-warn-bg: #fffaf2;
    --v43-warn-border: #ead8b1;
    --v43-ready-bg: #f8fcfa;
    --v43-ready-border: #d5eadf;
    --v43-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v43-board {
    background: #fff;
    border: 1px solid var(--v43-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v43-shadow);
}

.v43-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v43-border);
}

.v43-hero span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v43-hero h2 {
    margin: 0;
    color: var(--v43-text);
    font-size: 22px;
    line-height: 1.45;
}

.v43-hero p {
    margin: 4px 0 0;
    color: var(--v43-muted);
    font-size: 12.4px;
    line-height: 1.65;
}

.v43-hero-actions,
.v43-bulk-actions,
.v43-pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v43-hero-actions a,
.v43-search button,
.v43-search a,
.v43-bulk-actions button,
.v43-review-link,
.v43-pagination a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v43-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v43-hero-actions .is-primary,
.v43-bulk-actions button,
.v43-search button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* مؤشرات وفلاتر */
.v43-status-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v43-border);
}

.v43-status-strip a {
    min-height: 46px;
    border: 1px solid var(--v43-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v43-status-strip a.active {
    border-color: rgba(47, 113, 136, .42);
    background: #f7fcfd;
    box-shadow: inset 0 0 0 1px rgba(47, 113, 136, .10);
}

.v43-status-strip a.warn {
    background: #fffdf8;
}

.v43-status-strip a.ok {
    background: #f8fcfa;
}

.v43-status-strip span {
    color: var(--v43-muted);
    font-size: 11.3px;
}

.v43-status-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v43-tools {
    padding: 8px 0;
    border-bottom: 1px solid var(--v43-border);
}

.v43-filter-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.v43-filter-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.v43-filter-pills a,
.v43-view-toggle a {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--v43-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 500;
}

.v43-filter-pills a.active,
.v43-view-toggle a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v43-filter-pills strong {
    min-width: 22px;
    min-height: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.v43-view-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.v43-view-toggle > span {
    color: var(--v43-muted);
    font-size: 11.5px;
}

.v43-search {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 7px;
}

.v43-search input[type="search"],
.v43-bulk-actions select {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--v43-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v43-text);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12.4px;
    outline: none;
}

/* جدول */
.v43-table-panel {
    padding-top: 8px;
}

.v43-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.v43-panel-head h3 {
    margin: 0;
    color: var(--v43-text);
    font-size: 16px;
    line-height: 1.35;
}

.v43-panel-head p {
    margin: 2px 0 0;
    color: var(--v43-muted);
    font-size: 11.8px;
}

.v43-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v43-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v43-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v43-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v43-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v43-border);
    color: var(--v43-text);
    font-size: 12.4px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v43-table tbody tr:hover td {
    background: #fbfdfe;
}

.v43-table tr.needs-action td {
    background: #fffdf8;
}

.v43-table tr.needs-action:hover td {
    background: #fffaf0;
}

.v43-table .col-select {
    width: 42px;
}

.v43-table .col-index {
    width: 46px;
}

.v43-table .col-candidate {
    width: 22%;
}

.v43-table .col-opportunity {
    width: 28%;
}

.v43-table .col-score {
    width: 120px;
}

.v43-table .col-action {
    width: 94px;
}

.select-cell,
.index-cell,
.score-cell {
    text-align: center;
}

.index-cell {
    color: var(--v43-muted);
    font-size: 11.8px;
}

.candidate-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v43-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.candidate-cell span,
.opportunity-cell span,
.score-cell span,
.v43-table small {
    display: block;
    color: var(--v43-muted);
    font-size: 11.3px;
    line-height: 1.42;
}

.score-cell strong {
    color: var(--primary-dark);
    font-size: 16px;
}

.v43-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v43-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v43-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v43-review-link {
    min-height: 28px;
    padding: 4px 10px;
}

.v43-pagination {
    justify-content: center;
    margin-top: 9px;
}

.v43-pagination span {
    color: var(--v43-muted);
    font-size: 12px;
}

@media (max-width: 1220px) {
    .v43-hero,
    .v43-panel-head,
    .v43-filter-line {
        flex-direction: column;
        align-items: stretch;
    }

    .v43-status-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v43-table-wrap {
        overflow-x: auto;
    }

    .v43-table {
        min-width: 980px;
    }

    .v43-search {
        grid-template-columns: 1fr auto;
    }
}

@media (max-width: 720px) {
    body:has(.v43-applications) .page,
    body:has(.v43-applications) .container,
    body:has(.v43-applications) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v43-status-strip,
    .v43-search {
        grid-template-columns: 1fr;
    }
}


/* ===== V44 Applications: clean header, one filter row, one tools row ===== */

body:has(.v44-applications) {
    font-weight: 400;
}

body:has(.v44-applications) strong,
body:has(.v44-applications) b,
body:has(.v44-applications) h1,
body:has(.v44-applications) h2,
body:has(.v44-applications) h3,
body:has(.v44-applications) h4 {
    font-weight: 500;
}

body:has(.v44-applications) .page,
body:has(.v44-applications) .container,
body:has(.v44-applications) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v44-applications {
    --v44-border: #dce7eb;
    --v44-soft: #f7fafb;
    --v44-text: #253842;
    --v44-muted: #7c8b92;
    --v44-warn-bg: #fffaf2;
    --v44-warn-border: #ead8b1;
    --v44-ready-bg: #f8fcfa;
    --v44-ready-border: #d5eadf;
    --v44-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v44-board {
    background: #fff;
    border: 1px solid var(--v44-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v44-shadow);
}

.v44-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v44-border);
}

.v44-hero span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v44-hero h2 {
    margin: 0;
    color: var(--v44-text);
    font-size: 22px;
    line-height: 1.45;
}

.v44-hero p {
    margin: 4px 0 0;
    color: var(--v44-muted);
    font-size: 12.4px;
    line-height: 1.65;
}

.v44-hero-actions,
.v44-bulk-actions,
.v44-pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v44-hero-actions a,
.v44-search button,
.v44-search a,
.v44-bulk-actions button,
.v44-review-link,
.v44-pagination a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v44-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v44-hero-actions .is-primary,
.v44-bulk-actions button,
.v44-search button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ملخص سريع غير قابل للنقر حتى لا يختلط بالفلاتر */
.v44-status-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v44-border);
}

.v44-status-strip div {
    min-height: 50px;
    border: 1px solid var(--v44-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v44-status-strip div.warn {
    background: var(--v44-warn-bg);
    border-color: var(--v44-warn-border);
}

.v44-status-strip div.ok {
    background: var(--v44-ready-bg);
    border-color: var(--v44-ready-border);
}

.v44-status-strip span {
    color: var(--v44-muted);
    font-size: 11.3px;
}

.v44-status-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v44-status-strip small {
    color: var(--v44-muted);
    font-size: 10.4px;
    line-height: 1.25;
}

/* منطقة أدوات واحدة */
.v44-tools {
    padding: 8px 0;
    border-bottom: 1px solid var(--v44-border);
}

.v44-filter-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.v44-filter-pills a,
.v44-view-toggle a {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--v44-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 500;
}

.v44-filter-pills a.active,
.v44-view-toggle a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v44-filter-pills strong {
    min-width: 22px;
    min-height: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.v44-tools-row {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.v44-search {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 7px;
}

.v44-search input[type="search"],
.v44-bulk-actions select {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--v44-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v44-text);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12.4px;
    outline: none;
}

.v44-view-toggle {
    min-height: 34px;
    border: 1px solid var(--v44-border);
    border-radius: 12px;
    background: var(--v44-soft);
    padding: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.v44-view-toggle > span {
    color: var(--v44-muted);
    font-size: 11.5px;
    padding-inline: 6px;
}

.v44-bulk-actions {
    min-height: 34px;
    border: 1px solid var(--v44-border);
    border-radius: 12px;
    background: var(--v44-soft);
    padding: 3px;
}

.v44-bulk-actions select {
    min-width: 150px;
    min-height: 28px;
    border-radius: 8px;
    font-size: 11.8px;
    padding: 4px 8px;
}

/* جدول */
.v44-table-panel {
    padding-top: 8px;
}

.v44-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.v44-panel-head h3 {
    margin: 0;
    color: var(--v44-text);
    font-size: 16px;
    line-height: 1.35;
}

.v44-panel-head p {
    margin: 2px 0 0;
    color: var(--v44-muted);
    font-size: 11.8px;
}

.v44-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v44-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v44-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v44-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v44-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v44-border);
    color: var(--v44-text);
    font-size: 12.4px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v44-table tbody tr:hover td {
    background: #fbfdfe;
}

.v44-table tr.needs-action td {
    background: #fffdf8;
}

.v44-table tr.needs-action:hover td {
    background: #fffaf0;
}

.v44-table .col-select {
    width: 42px;
}

.v44-table .col-index {
    width: 46px;
}

.v44-table .col-candidate {
    width: 22%;
}

.v44-table .col-opportunity {
    width: 28%;
}

.v44-table .col-score {
    width: 120px;
}

.v44-table .col-action {
    width: 94px;
}

.select-cell,
.index-cell,
.score-cell {
    text-align: center;
}

.index-cell {
    color: var(--v44-muted);
    font-size: 11.8px;
}

.candidate-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v44-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.candidate-cell span,
.opportunity-cell span,
.score-cell span,
.v44-table small {
    display: block;
    color: var(--v44-muted);
    font-size: 11.3px;
    line-height: 1.42;
}

.score-cell strong {
    color: var(--primary-dark);
    font-size: 16px;
}

.v44-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v44-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v44-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v44-review-link {
    min-height: 28px;
    padding: 4px 10px;
}

.v44-pagination {
    justify-content: center;
    margin-top: 9px;
}

.v44-pagination span {
    color: var(--v44-muted);
    font-size: 12px;
}

@media (max-width: 1220px) {
    .v44-hero,
    .v44-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v44-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v44-tools-row {
        grid-template-columns: 1fr;
    }

    .v44-search {
        grid-template-columns: 1fr auto;
    }

    .v44-table-wrap {
        overflow-x: auto;
    }

    .v44-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v44-applications) .page,
    body:has(.v44-applications) .container,
    body:has(.v44-applications) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v44-status-strip,
    .v44-search {
        grid-template-columns: 1fr;
    }
}


/* ===== V45 Applications: organize tools and move bulk actions close to the table ===== */

body:has(.v45-applications) {
    font-weight: 400;
}

body:has(.v45-applications) strong,
body:has(.v45-applications) b,
body:has(.v45-applications) h1,
body:has(.v45-applications) h2,
body:has(.v45-applications) h3,
body:has(.v45-applications) h4 {
    font-weight: 500;
}

body:has(.v45-applications) .page,
body:has(.v45-applications) .container,
body:has(.v45-applications) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v45-applications {
    --v45-border: #dce7eb;
    --v45-soft: #f7fafb;
    --v45-text: #253842;
    --v45-muted: #7c8b92;
    --v45-warn-bg: #fffaf2;
    --v45-warn-border: #ead8b1;
    --v45-ready-bg: #f8fcfa;
    --v45-ready-border: #d5eadf;
    --v45-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v45-board {
    background: #fff;
    border: 1px solid var(--v45-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v45-shadow);
}

.v45-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v45-border);
}

.v45-hero span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v45-hero h2 {
    margin: 0;
    color: var(--v45-text);
    font-size: 22px;
    line-height: 1.45;
}

.v45-hero p {
    margin: 4px 0 0;
    color: var(--v45-muted);
    font-size: 12.3px;
    line-height: 1.62;
}

.v45-hero-actions,
.v45-bulk-actions,
.v45-pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v45-hero-actions a,
.v45-search button,
.v45-search a,
.v45-bulk-actions button,
.v45-review-link,
.v45-pagination a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v45-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v45-hero-actions .is-primary,
.v45-bulk-actions button,
.v45-search button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* مؤشرات سريعة */
.v45-status-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v45-border);
}

.v45-status-strip div {
    min-height: 50px;
    border: 1px solid var(--v45-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v45-status-strip div.warn {
    background: var(--v45-warn-bg);
    border-color: var(--v45-warn-border);
}

.v45-status-strip div.ok {
    background: var(--v45-ready-bg);
    border-color: var(--v45-ready-border);
}

.v45-status-strip span {
    color: var(--v45-muted);
    font-size: 11.3px;
}

.v45-status-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v45-status-strip small {
    color: var(--v45-muted);
    font-size: 10.4px;
    line-height: 1.25;
}

/* فلاتر وأدوات بحث فقط */
.v45-tools {
    padding: 8px 0;
    border-bottom: 1px solid var(--v45-border);
}

.v45-filter-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.v45-filter-pills a,
.v45-view-toggle a {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--v45-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 500;
}

.v45-filter-pills a.active,
.v45-view-toggle a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v45-filter-pills strong {
    min-width: 22px;
    min-height: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.v45-tools-row {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.v45-search {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 7px;
}

.v45-search input[type="search"],
.v45-bulk-actions select {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--v45-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v45-text);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12.4px;
    outline: none;
}

.v45-view-toggle {
    min-height: 34px;
    border: 1px solid var(--v45-border);
    border-radius: 12px;
    background: var(--v45-soft);
    padding: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.v45-view-toggle > span {
    color: var(--v45-muted);
    font-size: 11.5px;
    padding-inline: 6px;
}

/* منطقة الإجراء الجماعي بجانب الجدول لا بجانب البحث */
.v45-table-panel {
    padding-top: 8px;
}

.v45-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.v45-panel-head h3 {
    margin: 0;
    color: var(--v45-text);
    font-size: 16px;
    line-height: 1.35;
}

.v45-panel-head p {
    margin: 2px 0 0;
    color: var(--v45-muted);
    font-size: 11.8px;
}

.v45-bulk-zone {
    min-height: 40px;
    border: 1px solid var(--v45-border);
    border-radius: 13px;
    background: var(--v45-soft);
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.v45-bulk-zone > span {
    color: var(--v45-muted);
    font-size: 11.6px;
    padding-inline: 6px;
    white-space: nowrap;
}

.v45-bulk-actions select {
    min-width: 170px;
    min-height: 30px;
    border-radius: 9px;
    font-size: 11.8px;
    padding: 4px 8px;
}

/* جدول الطلبات */
.v45-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v45-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v45-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v45-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v45-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v45-border);
    color: var(--v45-text);
    font-size: 12.4px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v45-table tbody tr:hover td {
    background: #fbfdfe;
}

.v45-table tr.needs-action td {
    background: #fffdf8;
}

.v45-table tr.needs-action:hover td {
    background: #fffaf0;
}

.v45-table .col-select {
    width: 42px;
}

.v45-table .col-index {
    width: 46px;
}

.v45-table .col-candidate {
    width: 22%;
}

.v45-table .col-opportunity {
    width: 28%;
}

.v45-table .col-score {
    width: 120px;
}

.v45-table .col-action {
    width: 94px;
}

.select-cell,
.index-cell,
.score-cell {
    text-align: center;
}

.index-cell {
    color: var(--v45-muted);
    font-size: 11.8px;
}

.candidate-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v45-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.candidate-cell span,
.opportunity-cell span,
.score-cell span,
.v45-table small {
    display: block;
    color: var(--v45-muted);
    font-size: 11.3px;
    line-height: 1.42;
}

.score-cell strong {
    color: var(--primary-dark);
    font-size: 16px;
}

.v45-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v45-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v45-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v45-review-link {
    min-height: 28px;
    padding: 4px 10px;
}

.v45-pagination {
    justify-content: center;
    margin-top: 9px;
}

.v45-pagination span {
    color: var(--v45-muted);
    font-size: 12px;
}

@media (max-width: 1220px) {
    .v45-hero,
    .v45-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v45-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v45-tools-row {
        grid-template-columns: 1fr;
    }

    .v45-search {
        grid-template-columns: 1fr auto;
    }

    .v45-table-wrap {
        overflow-x: auto;
    }

    .v45-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v45-applications) .page,
    body:has(.v45-applications) .container,
    body:has(.v45-applications) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v45-status-strip,
    .v45-search {
        grid-template-columns: 1fr;
    }

    .v45-bulk-zone,
    .v45-bulk-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .v45-bulk-actions select,
    .v45-bulk-actions button {
        width: 100%;
    }
}


/* ===== V46 Applications: precise tools and row-density polish ===== */

body:has(.v46-applications) {
    font-weight: 400;
}

body:has(.v46-applications) strong,
body:has(.v46-applications) b,
body:has(.v46-applications) h1,
body:has(.v46-applications) h2,
body:has(.v46-applications) h3,
body:has(.v46-applications) h4 {
    font-weight: 500;
}

body:has(.v46-applications) .page,
body:has(.v46-applications) .container,
body:has(.v46-applications) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v46-applications {
    --v46-border: #dce7eb;
    --v46-soft: #f7fafb;
    --v46-text: #253842;
    --v46-muted: #7c8b92;
    --v46-warn-bg: #fffaf2;
    --v46-warn-border: #ead8b1;
    --v46-ready-bg: #f8fcfa;
    --v46-ready-border: #d5eadf;
    --v46-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v46-board {
    background: #fff;
    border: 1px solid var(--v46-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v46-shadow);
}

.v46-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v46-border);
}

.v46-hero span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v46-hero h2 {
    margin: 0;
    color: var(--v46-text);
    font-size: 22px;
    line-height: 1.45;
}

.v46-hero p {
    margin: 4px 0 0;
    color: var(--v46-muted);
    font-size: 12.2px;
    line-height: 1.6;
}

.v46-hero-actions,
.v46-pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v46-hero-actions a,
.v46-search button,
.v46-search a,
.v46-bulk-actions button,
.v46-review-link,
.v46-pagination a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v46-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v46-hero-actions .is-primary,
.v46-bulk-actions button,
.v46-search button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* مؤشرات سريعة */
.v46-status-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v46-border);
}

.v46-status-strip div {
    min-height: 48px;
    border: 1px solid var(--v46-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v46-status-strip div.warn {
    background: var(--v46-warn-bg);
    border-color: var(--v46-warn-border);
}

.v46-status-strip div.ok {
    background: var(--v46-ready-bg);
    border-color: var(--v46-ready-border);
}

.v46-status-strip span {
    color: var(--v46-muted);
    font-size: 11.3px;
}

.v46-status-strip strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v46-status-strip small {
    color: var(--v46-muted);
    font-size: 10.4px;
    line-height: 1.25;
}

/* فلاتر وأدوات بحث */
.v46-tools {
    padding: 8px 0;
    border-bottom: 1px solid var(--v46-border);
}

.v46-filter-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.v46-filter-pills a,
.v46-view-toggle a {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--v46-border);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 500;
}

.v46-filter-pills a.active,
.v46-view-toggle a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v46-filter-pills strong {
    min-width: 22px;
    min-height: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.65);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.v46-tools-row {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.v46-search {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 7px;
}

.v46-search input[type="search"],
.v46-bulk-actions select {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--v46-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v46-text);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12.4px;
    outline: none;
}

.v46-view-toggle {
    min-height: 34px;
    border: 1px solid var(--v46-border);
    border-radius: 12px;
    background: var(--v46-soft);
    padding: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.v46-view-toggle > span {
    color: var(--v46-muted);
    font-size: 11.5px;
    padding-inline: 6px;
}

/* لوحة الجدول والإجراءات الجماعية */
.v46-table-panel {
    padding-top: 8px;
}

.v46-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 7px;
}

.v46-panel-head h3 {
    margin: 0;
    color: var(--v46-text);
    font-size: 16px;
    line-height: 1.35;
}

.v46-panel-head p {
    margin: 2px 0 0;
    color: var(--v46-muted);
    font-size: 11.7px;
}

.v46-table-toolbar {
    min-height: 40px;
    border: 1px solid var(--v46-border);
    border-radius: 13px;
    background: var(--v46-soft);
    padding: 5px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.v46-selected-hint {
    color: var(--v46-muted);
    font-size: 11.8px;
    padding-inline: 6px;
}

.v46-bulk-actions {
    display: grid;
    grid-template-columns: auto 190px auto;
    align-items: center;
    gap: 6px;
}

.v46-bulk-actions > span {
    color: var(--v46-muted);
    font-size: 11.6px;
    white-space: nowrap;
}

.v46-bulk-actions select {
    min-width: 190px;
    min-height: 30px;
    border-radius: 9px;
    font-size: 11.8px;
    padding: 4px 8px;
}

.v46-bulk-actions button {
    min-height: 30px;
}

/* جدول الطلبات */
.v46-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v46-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v46-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v46-border);
    padding: 6px 8px;
    text-align: right;
    font-size: 11.3px;
    font-weight: 500;
    white-space: nowrap;
}

.v46-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--v46-border);
    color: var(--v46-text);
    font-size: 12.3px;
    font-weight: 400;
    line-height: 1.38;
    vertical-align: middle;
}

.v46-table tbody tr:hover td {
    background: #fbfdfe;
}

.v46-table tr.needs-action td {
    background: #fffdf8;
}

.v46-table tr.needs-action:hover td {
    background: #fffaf0;
}

.v46-table .col-select {
    width: 42px;
}

.v46-table .col-index {
    width: 46px;
}

.v46-table .col-candidate {
    width: 22%;
}

.v46-table .col-opportunity {
    width: 28%;
}

.v46-table .col-score {
    width: 120px;
}

.v46-table .col-action {
    width: 94px;
}

.select-cell,
.index-cell,
.score-cell {
    text-align: center;
}

.index-cell {
    color: var(--v46-muted);
    font-size: 11.8px;
}

.candidate-cell strong,
.opportunity-cell strong {
    display: block;
    color: var(--v46-text);
    font-size: 12.8px;
    font-weight: 500;
    margin-bottom: 1px;
}

.candidate-cell span,
.opportunity-cell span,
.score-cell span,
.v46-table small {
    display: block;
    color: var(--v46-muted);
    font-size: 11.2px;
    line-height: 1.35;
}

.v46-table small {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-cell strong {
    color: var(--primary-dark);
    font-size: 15.5px;
}

.v46-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v46-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v46-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v46-review-link {
    min-height: 28px;
    padding: 4px 10px;
}

.v46-pagination {
    justify-content: center;
    margin-top: 9px;
}

.v46-pagination span {
    color: var(--v46-muted);
    font-size: 12px;
}

@media (max-width: 1220px) {
    .v46-hero,
    .v46-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v46-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v46-tools-row,
    .v46-table-toolbar {
        grid-template-columns: 1fr;
    }

    .v46-search {
        grid-template-columns: 1fr auto;
    }

    .v46-bulk-actions {
        justify-content: start;
    }

    .v46-table-wrap {
        overflow-x: auto;
    }

    .v46-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v46-applications) .page,
    body:has(.v46-applications) .container,
    body:has(.v46-applications) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v46-status-strip,
    .v46-search,
    .v46-bulk-actions {
        grid-template-columns: 1fr;
    }

    .v46-bulk-actions select,
    .v46-bulk-actions button {
        width: 100%;
    }
}


/* ===== V47 Application Detail: decision-first request processing screen ===== */

body:has(.v47-application-page) {
    font-weight: 400;
}

body:has(.v47-application-page) strong,
body:has(.v47-application-page) b,
body:has(.v47-application-page) h1,
body:has(.v47-application-page) h2,
body:has(.v47-application-page) h3,
body:has(.v47-application-page) h4 {
    font-weight: 500;
}

body:has(.v47-application-page) .page,
body:has(.v47-application-page) .container,
body:has(.v47-application-page) main {
    max-width: min(1480px, calc(100% - 44px)) !important;
    width: min(1480px, calc(100% - 44px)) !important;
}

.v47-application-page {
    --v47-border: #dce7eb;
    --v47-soft: #f7fafb;
    --v47-text: #253842;
    --v47-muted: #7c8b92;
    --v47-warn-bg: #fffaf2;
    --v47-warn-border: #ead8b1;
    --v47-ready-bg: #f8fcfa;
    --v47-ready-border: #d5eadf;
    --v47-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v47-board {
    background: #fff;
    border: 1px solid var(--v47-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v47-shadow);
}

.v47-hero,
.v47-decision-head,
.v47-section-head,
.v47-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v47-hero {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v47-border);
}

.v47-hero span,
.v47-section-head span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v47-hero h2,
.v47-decision-head h3,
.v47-section-head h3,
.v47-card-head h3,
.v47-score-top h3 {
    margin: 0;
    color: var(--v47-text);
    line-height: 1.4;
}

.v47-hero h2 {
    font-size: 22px;
}

.v47-decision-head h3,
.v47-section-head h3,
.v47-card-head h3,
.v47-score-top h3 {
    font-size: 16px;
}

.v47-hero p,
.v47-decision-head p,
.v47-section-head p,
.v47-table-head p,
.v47-score-top p {
    margin: 3px 0 0;
    color: var(--v47-muted);
    font-size: 12.2px;
    line-height: 1.6;
}

.v47-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v47-hero-actions a,
.v47-table-head a,
.v47-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v47-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v47-hero-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ملخص القرار */
.v47-summary-strip {
    display: grid;
    grid-template-columns: 1.15fr 1.15fr .72fr .72fr .62fr .82fr;
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v47-border);
}

.v47-summary-strip div {
    min-height: 48px;
    border: 1px solid var(--v47-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v47-summary-strip span {
    color: var(--v47-muted);
    font-size: 11.3px;
}

.v47-summary-strip strong {
    color: var(--primary-dark);
    font-size: 14px;
    line-height: 1.35;
}

.v47-summary-strip strong.ok,
.v47-chip.ok,
.v47-state-badges .ok {
    color: var(--success);
}

.v47-summary-strip strong.warn,
.v47-chip.warn,
.v47-state-badges .warn {
    color: #8a5a00;
}

/* التنبيه */
.v47-alert {
    margin-top: 8px;
    border: 1px solid var(--v47-warn-border);
    border-radius: 12px;
    background: var(--v47-warn-bg);
    color: #694300;
    padding: 8px 10px;
    font-size: 12.4px;
    line-height: 1.55;
}

.v47-alert strong {
    color: #8a5a00;
}

/* قرار المعالجة */
.v47-decision-card {
    margin-top: 8px;
    border: 1px solid var(--v47-border);
    border-radius: 14px;
    background: #fbfdfe;
    padding: 10px;
}

.v47-decision-head {
    margin-bottom: 8px;
}

.v47-state-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v47-state-badges span,
.v47-chip {
    min-height: 24px;
    border: 1px solid var(--v47-border);
    border-radius: 999px;
    background: #fff;
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    font-size: 11.6px;
    font-weight: 500;
}

.v47-state-badges .ok,
.v47-chip.ok {
    background: #edf8f2;
    border-color: #d4eadf;
}

.v47-state-badges .warn,
.v47-chip.warn {
    background: #fff6e7;
    border-color: #ead8b1;
}

.v47-decision-form {
    display: grid;
    gap: 8px;
}

.v47-decision-buttons {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
}

.v47-decision-buttons button {
    min-height: 34px;
    border: 1px solid var(--v47-border);
    border-radius: 10px;
    background: #fff;
    color: var(--primary-dark);
    padding: 6px 8px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    cursor: pointer;
}

.v47-decision-buttons .primary-action {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v47-decision-buttons .warning-action {
    background: #fff8ed;
    border-color: var(--v47-warn-border);
    color: #8a5a00;
}

.v47-note-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px;
    align-items: start;
}

.v47-note-grid label {
    color: var(--v47-text);
    font-size: 12.2px;
    line-height: 1.5;
    padding-top: 5px;
}

.v47-note-grid label span {
    display: block;
    color: var(--v47-muted);
    font-size: 10.8px;
    margin-top: 2px;
}

.v47-note-grid textarea {
    width: 100%;
    min-height: 58px;
    max-height: 100px;
    border: 1px solid var(--v47-border);
    border-radius: 12px;
    background: #fff;
    color: var(--v47-text);
    padding: 8px 10px;
    font-family: inherit;
    font-size: 12.3px;
    resize: vertical;
    outline: none;
}

.v47-note-hint {
    display: none;
    border: 1px solid var(--v47-warn-border);
    border-radius: 10px;
    background: var(--v47-warn-bg);
    color: #8a5a00;
    padding: 7px 9px;
    font-size: 11.8px;
}

.v47-note-hint.show {
    display: block;
}

/* المحتوى */
.v47-content {
    padding-top: 10px;
}

.v47-section-head {
    margin-bottom: 8px;
}

.v47-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.v47-card {
    border: 1px solid var(--v47-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

.v47-card-head {
    margin-bottom: 7px;
}

.v47-info-list {
    margin: 0;
    display: grid;
    gap: 0;
}

.v47-info-list div {
    min-height: 33px;
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid var(--v47-border);
}

.v47-info-list div:last-child {
    border-bottom: 0;
}

.v47-info-list dt {
    color: var(--v47-muted);
    font-size: 11.8px;
}

.v47-info-list dd {
    margin: 0;
    color: var(--v47-text);
    font-size: 12.4px;
    line-height: 1.45;
}

.v47-score-card {
    background: #fbfdfe;
}

.v47-score-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.v47-score-total {
    min-width: 116px;
    border: 1px solid var(--v47-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 10px;
    display: grid;
    gap: 2px;
    text-align: center;
}

.v47-score-total span {
    color: var(--v47-muted);
    font-size: 11.2px;
}

.v47-score-total strong {
    color: var(--primary-dark);
    font-size: 20px;
    line-height: 1;
}

.v47-empty-box {
    min-height: 68px;
    border: 1px dashed var(--v47-border);
    border-radius: 12px;
    background: #fff;
    color: var(--v47-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.4px;
}

/* قرارات PDF */
.v47-decisions-card {
    margin-top: 8px;
}

.v47-table-head {
    margin-bottom: 8px;
}

.v47-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v47-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v47-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v47-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v47-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v47-border);
    color: var(--v47-text);
    font-size: 12.4px;
    line-height: 1.45;
    vertical-align: middle;
}

.v47-table .empty {
    text-align: center;
    color: var(--v47-muted);
    padding: 16px 8px;
}

/* الرسائل */
.v47-application-page .messages {
    margin-bottom: 8px;
}

.v47-application-page .message {
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12.4px;
}

@media (max-width: 1220px) {
    .v47-hero,
    .v47-decision-head,
    .v47-section-head,
    .v47-table-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v47-summary-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v47-decision-buttons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v47-data-grid {
        grid-template-columns: 1fr;
    }

    .v47-table-wrap {
        overflow-x: auto;
    }

    .v47-table {
        min-width: 760px;
    }
}

@media (max-width: 720px) {
    body:has(.v47-application-page) .page,
    body:has(.v47-application-page) .container,
    body:has(.v47-application-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v47-summary-strip,
    .v47-decision-buttons,
    .v47-note-grid {
        grid-template-columns: 1fr;
    }

    .v47-info-list div {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 6px 0;
    }
}


/* ===== V48 Stage Detail: final stage center polish ===== */

body:has(.v48-stage-page) {
    font-weight: 400;
}

body:has(.v48-stage-page) strong,
body:has(.v48-stage-page) b,
body:has(.v48-stage-page) h1,
body:has(.v48-stage-page) h2,
body:has(.v48-stage-page) h3,
body:has(.v48-stage-page) h4 {
    font-weight: 500;
}

body:has(.v48-stage-page) .page,
body:has(.v48-stage-page) .container,
body:has(.v48-stage-page) main {
    max-width: min(1540px, calc(100% - 44px)) !important;
    width: min(1540px, calc(100% - 44px)) !important;
}

.v48-stage-page {
    --v48-border: #dce7eb;
    --v48-soft: #f7fafb;
    --v48-text: #253842;
    --v48-muted: #7c8b92;
    --v48-warn-bg: #fffaf2;
    --v48-warn-border: #ead8b1;
    --v48-ready-bg: #f8fcfa;
    --v48-ready-border: #d5eadf;
    --v48-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v48-board {
    background: #fff;
    border: 1px solid var(--v48-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v48-shadow);
}

.v48-hero,
.v48-content-head,
.v48-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v48-hero {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v48-border);
}

.v48-hero span,
.v48-content-head > div > span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v48-hero h2,
.v48-content-head h3 {
    margin: 0;
    color: var(--v48-text);
    line-height: 1.45;
}

.v48-hero h2 {
    font-size: 22px;
}

.v48-content-head h3 {
    font-size: 17px;
}

.v48-hero p,
.v48-content-head p {
    margin: 4px 0 0;
    color: var(--v48-muted);
    font-size: 12.3px;
    line-height: 1.62;
}

.v48-chip {
    min-height: 22px;
    border: 1px solid var(--v48-border);
    border-radius: 999px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 1px 8px;
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    margin-inline-start: 6px;
}

.v48-hero-actions,
.v48-content-tabs,
.v48-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v48-hero-actions a,
.v48-toolbar a,
.v48-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v48-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v48-hero-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* مؤشرات المرحلة */
.v48-kpis {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v48-border);
}

.v48-kpis a {
    min-height: 48px;
    border: 1px solid var(--v48-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v48-kpis a.ok {
    background: var(--v48-ready-bg);
    border-color: var(--v48-ready-border);
}

.v48-kpis a.warn {
    background: var(--v48-warn-bg);
    border-color: var(--v48-warn-border);
}

.v48-kpis span {
    color: var(--v48-muted);
    font-size: 11.3px;
}

.v48-kpis strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

/* مسار العمل */
.v48-workflow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v48-border);
}

.v48-step {
    min-height: 72px;
    border: 1px solid var(--v48-border);
    border-radius: 13px;
    background: #fbfdfe;
    padding: 8px;
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 8px;
}

.v48-step b {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.v48-step strong {
    display: block;
    color: var(--v48-text);
    font-size: 12.8px;
    line-height: 1.4;
}

.v48-step span {
    display: block;
    color: var(--v48-muted);
    font-size: 11.1px;
    line-height: 1.45;
    margin-top: 1px;
}

.v48-step a {
    min-height: 28px;
    border: 1px solid var(--v48-border);
    border-radius: 9px;
    background: #fff;
    color: var(--primary-dark);
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

/* محتوى المرحلة */
.v48-content-panel {
    padding-top: 9px;
}

.v48-content-head {
    margin-bottom: 8px;
}

.v48-content-tabs {
    border: 1px solid var(--v48-border);
    border-radius: 12px;
    background: var(--v48-soft);
    padding: 4px;
}

.v48-content-tabs a {
    min-height: 28px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--primary-dark);
    padding: 4px 9px;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v48-content-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v48-toolbar {
    justify-content: space-between;
    min-height: 38px;
    border: 1px dashed var(--v48-border);
    border-radius: 12px;
    background: #fbfdfe;
    padding: 6px 8px;
    margin-bottom: 8px;
}

.v48-toolbar span {
    color: var(--v48-muted);
    font-size: 11.8px;
}

/* جدول محتوى المرحلة */
.v48-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v48-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v48-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v48-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v48-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v48-border);
    color: var(--v48-text);
    font-size: 12.4px;
    font-weight: 400;
    line-height: 1.45;
    vertical-align: middle;
}

.v48-table tbody tr:hover td {
    background: #fbfdfe;
}

.v48-table tr.needs-action td {
    background: #fffdf8;
}

.v48-table .col-name {
    width: 34%;
}

.v48-table .col-action {
    width: 120px;
}

.name-cell strong {
    display: block;
    color: var(--v48-text);
    font-size: 12.9px;
    font-weight: 500;
    margin-bottom: 1px;
}

.name-cell span {
    display: block;
    color: var(--v48-muted);
    font-size: 11.3px;
}

.num-cell {
    text-align: center;
}

.v48-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    max-width: 100%;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v48-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v48-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v48-badge.strong {
    background: #e8f2f6;
    color: var(--primary-dark);
    border: 1px solid rgba(47, 113, 136, .20);
}

.v48-table .empty {
    text-align: center;
    color: var(--v48-muted);
    padding: 16px 8px;
}

@media (max-width: 1220px) {
    .v48-hero,
    .v48-content-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v48-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v48-workflow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v48-table-wrap {
        overflow-x: auto;
    }

    .v48-table {
        min-width: 880px;
    }
}

@media (max-width: 720px) {
    body:has(.v48-stage-page) .page,
    body:has(.v48-stage-page) .container,
    body:has(.v48-stage-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v48-kpis,
    .v48-workflow {
        grid-template-columns: 1fr;
    }

    .v48-step {
        grid-template-columns: 28px 1fr;
    }

    .v48-step a {
        grid-column: 1 / -1;
    }
}


/* ===== V49 Inquiry Center ===== */

body:has(.v49-inquiry-page) {
    font-weight: 400;
}

body:has(.v49-inquiry-page) strong,
body:has(.v49-inquiry-page) b,
body:has(.v49-inquiry-page) h1,
body:has(.v49-inquiry-page) h2,
body:has(.v49-inquiry-page) h3,
body:has(.v49-inquiry-page) h4 {
    font-weight: 500;
}

body:has(.v49-inquiry-page) .page,
body:has(.v49-inquiry-page) .container,
body:has(.v49-inquiry-page) main {
    max-width: min(1320px, calc(100% - 44px)) !important;
    width: min(1320px, calc(100% - 44px)) !important;
}

.v49-inquiry-page {
    --v49-border: #dce7eb;
    --v49-soft: #f7fafb;
    --v49-text: #253842;
    --v49-muted: #7c8b92;
    --v49-warn-bg: #fffaf2;
    --v49-warn-border: #ead8b1;
    --v49-ready-bg: #f8fcfa;
    --v49-ready-border: #d5eadf;
    --v49-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

/* صفحة الدخول */
.v49-login-page {
    min-height: 58vh;
    display: grid;
    place-items: center;
}

.v49-login-card {
    width: min(520px, 100%);
    border: 1px solid var(--v49-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--v49-shadow);
    padding: 18px;
}

.v49-login-head {
    margin-bottom: 14px;
}

.v49-login-head span,
.v49-hero span,
.v49-result-head span {
    display: block;
    color: var(--primary);
    font-size: 11px;
    line-height: 1.2;
    margin-bottom: 3px;
}

.v49-login-head h2,
.v49-hero h2,
.v49-result-head h3 {
    margin: 0;
    color: var(--v49-text);
    line-height: 1.45;
}

.v49-login-head h2,
.v49-hero h2 {
    font-size: 22px;
}

.v49-result-head h3 {
    font-size: 19px;
}

.v49-login-head p,
.v49-hero p,
.v49-result-head p {
    margin: 5px 0 0;
    color: var(--v49-muted);
    font-size: 12.4px;
    line-height: 1.65;
}

.v49-login-form {
    display: grid;
    gap: 10px;
}

.v49-login-form label {
    display: grid;
    gap: 5px;
    color: var(--v49-text);
    font-size: 12.4px;
}

.v49-login-form input,
.v49-search-form input {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--v49-border);
    border-radius: 11px;
    background: #fff;
    color: var(--v49-text);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.v49-login-form button,
.v49-search-form button,
.v49-reply-box button {
    min-height: 36px;
    border: 1px solid var(--primary);
    border-radius: 11px;
    background: var(--primary);
    color: #fff;
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}

.v49-login-note {
    margin-top: 12px;
    border: 1px solid var(--v49-border);
    border-radius: 12px;
    background: var(--v49-soft);
    color: var(--v49-muted);
    padding: 9px 10px;
    font-size: 11.8px;
    line-height: 1.6;
}

/* اللوحة */
.v49-board {
    background: #fff;
    border: 1px solid var(--v49-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v49-shadow);
}

.v49-hero,
.v49-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v49-hero {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v49-border);
}

.v49-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v49-hero-actions a,
.v49-safe-notes a {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v49-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v49-hero-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* بحث */
.v49-search-panel {
    padding: 10px 0;
    border-bottom: 1px solid var(--v49-border);
}

.v49-search-form {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    gap: 8px;
    align-items: center;
}

.v49-search-form label {
    color: var(--v49-text);
    font-size: 12.4px;
}

.v49-search-note {
    margin-top: 7px;
    color: var(--v49-muted);
    font-size: 11.8px;
    line-height: 1.55;
}

/* النتائج */
.v49-result,
.v49-empty-result {
    padding-top: 10px;
}

.v49-empty-result {
    border: 1px solid var(--v49-border);
    border-radius: 14px;
    background: #fff;
    padding: 14px;
    margin-top: 10px;
}

.v49-empty-result h3,
.v49-reason-card h3,
.v49-reply-box h4 {
    margin: 0;
    color: var(--v49-text);
    font-size: 15.5px;
    line-height: 1.4;
}

.v49-empty-result p,
.v49-reason-card p,
.v49-reply-box p {
    margin: 5px 0 0;
    color: var(--v49-muted);
    font-size: 12.5px;
    line-height: 1.7;
}

.v49-result-head {
    border: 1px solid var(--v49-border);
    border-radius: 14px;
    background: #fbfdfe;
    padding: 10px;
    margin-bottom: 8px;
}

.v49-result-status {
    min-height: 34px;
    border-radius: 999px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.v49-result-status.ok,
.v49-summary-grid strong.ok,
.v49-summary-grid strong.ok,
strong.ok {
    background: #edf8f2;
    color: var(--success);
}

.v49-result-status.warn,
.v49-summary-grid strong.warn,
strong.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v49-result-status.neutral,
.v49-summary-grid strong.neutral,
strong.neutral {
    background: #edf5f7;
    color: var(--primary-dark);
}

.v49-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 8px;
}

.v49-summary-grid div {
    min-height: 52px;
    border: 1px solid var(--v49-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 2px;
}

.v49-summary-grid span {
    color: var(--v49-muted);
    font-size: 11.4px;
}

.v49-summary-grid strong {
    color: var(--primary-dark);
    font-size: 13px;
    line-height: 1.45;
}

.v49-summary-grid strong.ok,
.v49-summary-grid strong.warn,
.v49-summary-grid strong.neutral {
    border-radius: 999px;
    padding: 2px 8px;
    display: inline-flex;
    justify-self: start;
    min-height: 22px;
    align-items: center;
}

.v49-reason-card,
.v49-reply-box,
.v49-safe-notes {
    border: 1px solid var(--v49-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
    margin-bottom: 8px;
}

.v49-reply-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    background: #fbfdfe;
}

.v49-safe-notes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--v49-soft);
}

.v49-safe-notes strong {
    display: block;
    color: var(--v49-text);
    font-size: 12.3px;
    margin-bottom: 2px;
}

.v49-safe-notes span {
    color: var(--v49-muted);
    font-size: 11.8px;
    line-height: 1.55;
}

/* تنبيهات */
.v49-alert,
.v49-message {
    border: 1px solid var(--v49-warn-border);
    border-radius: 12px;
    background: var(--v49-warn-bg);
    color: #8a5a00;
    padding: 8px 10px;
    font-size: 12.3px;
    line-height: 1.6;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .v49-hero,
    .v49-result-head,
    .v49-safe-notes,
    .v49-reply-box {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .v49-search-form,
    .v49-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    body:has(.v49-inquiry-page) .page,
    body:has(.v49-inquiry-page) .container,
    body:has(.v49-inquiry-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }
}


/* ===== V50 Inquiry Staff Management ===== */

body:has(.v50-staff-page) {
    font-weight: 400;
}

body:has(.v50-staff-page) strong,
body:has(.v50-staff-page) b,
body:has(.v50-staff-page) h1,
body:has(.v50-staff-page) h2,
body:has(.v50-staff-page) h3,
body:has(.v50-staff-page) h4 {
    font-weight: 500;
}

body:has(.v50-staff-page) .page,
body:has(.v50-staff-page) .container,
body:has(.v50-staff-page) main {
    max-width: min(1360px, calc(100% - 44px)) !important;
    width: min(1360px, calc(100% - 44px)) !important;
}

.v50-staff-page {
    --v50-border: #dce7eb;
    --v50-soft: #f7fafb;
    --v50-text: #253842;
    --v50-muted: #7c8b92;
    --v50-warn-bg: #fffaf2;
    --v50-warn-border: #ead8b1;
    --v50-ready-bg: #f8fcfa;
    --v50-ready-border: #d5eadf;
    --v50-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v50-board,
.v50-form-card {
    background: #fff;
    border: 1px solid var(--v50-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v50-shadow);
}

.v50-form-card {
    width: min(920px, 100%);
    margin-inline: auto;
}

.v50-hero,
.v50-form-head,
.v50-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v50-hero,
.v50-form-head {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v50-border);
}

.v50-hero span,
.v50-form-head span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v50-hero h2,
.v50-form-head h2,
.v50-panel-head h3 {
    margin: 0;
    color: var(--v50-text);
    line-height: 1.45;
}

.v50-hero h2,
.v50-form-head h2 {
    font-size: 22px;
}

.v50-panel-head h3 {
    font-size: 16px;
}

.v50-hero p,
.v50-form-head p,
.v50-panel-head p {
    margin: 4px 0 0;
    color: var(--v50-muted);
    font-size: 12.3px;
    line-height: 1.62;
}

.v50-hero-actions,
.v50-form-head nav,
.v50-form-actions,
.v50-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v50-hero-actions a,
.v50-form-head a,
.v50-search button,
.v50-search a,
.v50-form-actions button,
.v50-form-actions a,
.v50-row-actions a,
.v50-row-actions button {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v50-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.v50-hero-actions .is-primary,
.v50-search button,
.v50-form-actions button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v50-row-actions form {
    margin: 0;
}

.v50-row-actions button {
    background: #fff8ed;
    border-color: var(--v50-warn-border);
    color: #8a5a00;
}

.v50-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v50-border);
}

.v50-kpis div {
    min-height: 48px;
    border: 1px solid var(--v50-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v50-kpis .ok {
    background: var(--v50-ready-bg);
    border-color: var(--v50-ready-border);
}

.v50-kpis .warn {
    background: var(--v50-warn-bg);
    border-color: var(--v50-warn-border);
}

.v50-kpis span,
.v50-note,
.v50-help-box {
    color: var(--v50-muted);
    font-size: 11.8px;
    line-height: 1.55;
}

.v50-kpis strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v50-tools {
    padding: 8px 0;
    border-bottom: 1px solid var(--v50-border);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.v50-search {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 7px;
}

.v50-search input,
.v50-staff-form input,
.v50-staff-form select {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--v50-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v50-text);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 12.6px;
    outline: none;
}

.v50-table-panel {
    padding-top: 8px;
}

.v50-panel-head {
    margin-bottom: 8px;
}

.v50-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v50-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v50-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v50-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v50-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v50-border);
    color: var(--v50-text);
    font-size: 12.3px;
    line-height: 1.45;
    vertical-align: middle;
}

.v50-table tbody tr:hover td {
    background: #fbfdfe;
}

.v50-table tr.is-inactive td {
    color: #7d8588;
    background: #fbfbfb;
}

.v50-table .col-name {
    width: 24%;
}

.v50-table .col-action {
    width: 245px;
}

.name-cell strong {
    display: block;
    color: var(--v50-text);
    font-size: 12.8px;
    margin-bottom: 1px;
}

.name-cell span {
    display: block;
    color: var(--v50-muted);
    font-size: 11.2px;
}

.num-cell {
    text-align: center;
}

.v50-badge {
    min-height: 21px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    padding: 1px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.4px;
    font-weight: 500;
}

.v50-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v50-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v50-table .empty {
    text-align: center;
    color: var(--v50-muted);
    padding: 16px 8px;
}

/* النماذج */
.v50-staff-form {
    padding-top: 10px;
    display: grid;
    gap: 10px;
}

.v50-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.v50-form-grid.one {
    grid-template-columns: 1fr;
}

.v50-staff-form label {
    display: grid;
    gap: 5px;
    color: var(--v50-text);
    font-size: 12.4px;
}

.v50-checks {
    border: 1px solid var(--v50-border);
    border-radius: 12px;
    background: var(--v50-soft);
    padding: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.v50-checks label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.v50-checks input {
    width: auto;
    min-height: auto;
}

.v50-help-box {
    border: 1px solid var(--v50-border);
    border-radius: 12px;
    background: #fbfdfe;
    padding: 9px 10px;
}

.v50-errors,
.v50-message {
    border: 1px solid var(--v50-warn-border);
    border-radius: 12px;
    background: var(--v50-warn-bg);
    color: #8a5a00;
    padding: 8px 10px;
    font-size: 12.3px;
    line-height: 1.6;
    margin-top: 8px;
}

.v50-message--success {
    border-color: var(--v50-ready-border);
    background: var(--v50-ready-bg);
    color: var(--success);
}

.v50-messages {
    margin-bottom: 8px;
}

@media (max-width: 1100px) {
    .v50-hero,
    .v50-form-head,
    .v50-panel-head,
    .v50-tools {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .v50-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v50-table-wrap {
        overflow-x: auto;
    }

    .v50-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v50-staff-page) .page,
    body:has(.v50-staff-page) .container,
    body:has(.v50-staff-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v50-kpis,
    .v50-search,
    .v50-form-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== V52 Inquiry Center Polish ===== */

.v52-inquiry-polish .v49-hero {
    align-items: flex-start;
}

.v52-inquiry-polish .v49-hero-actions {
    align-self: center;
}

.v52-brief-reply {
    border: 1px solid var(--v49-border);
    border-radius: 14px;
    background: #fbfdfe;
    padding: 10px;
    margin-bottom: 8px;
    display: grid;
    gap: 4px;
}

.v52-brief-reply span {
    color: var(--primary);
    font-size: 11.2px;
    line-height: 1.2;
}

.v52-brief-reply strong {
    color: var(--v49-text);
    font-size: 14.2px;
    line-height: 1.65;
}

.v52-brief-reply.ok {
    background: #f8fcfa;
    border-color: #d5eadf;
}

.v52-brief-reply.warn {
    background: #fffaf2;
    border-color: #ead8b1;
}

.v52-brief-reply.neutral {
    background: #f7fafb;
    border-color: var(--v49-border);
}

.v52-brief-reply.ok strong {
    color: var(--success);
}

.v52-brief-reply.warn strong {
    color: #8a5a00;
}

.v52-inquiry-polish .v49-result-head,
.v52-inquiry-polish .v49-summary-grid,
.v52-inquiry-polish .v49-reason-card,
.v52-inquiry-polish .v49-reply-box,
.v52-inquiry-polish .v49-safe-notes {
    margin-bottom: 8px;
}

.v52-inquiry-polish .v49-empty-result .v49-reply-box {
    margin-top: 8px;
}

@media (max-width: 900px) {
    .v52-inquiry-polish .v49-hero-actions {
        align-self: stretch;
    }
}


/* ===== V53 Inquiry Center: balanced national ID field ===== */

/* خانة السجل المدني قصيرة لأنها 10 أرقام فقط */
.v52-inquiry-polish .v49-search-form {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.v52-inquiry-polish .v49-search-form label {
    flex: 0 0 auto;
    min-width: 92px;
    color: var(--v49-text);
    font-size: 12.4px;
    white-space: nowrap;
}

.v52-inquiry-polish .v49-search-form input[name="national_id"] {
    flex: 0 0 360px;
    width: 360px;
    max-width: 360px;
    text-align: center;
    letter-spacing: .4px;
    direction: ltr;
}

.v52-inquiry-polish .v49-search-form button {
    flex: 0 0 auto;
    min-width: 88px;
}

/* تقليل الفراغ أسفل منطقة البحث بعد حذف العبارات */
.v52-inquiry-polish .v49-search-panel {
    padding: 10px 0 8px;
}

/* عند الشاشات المتوسطة يبقى الحقل متناسقًا دون تمدد مبالغ */
@media (max-width: 900px) {
    .v52-inquiry-polish .v49-search-form {
        display: grid;
        grid-template-columns: 100px minmax(240px, 360px) auto;
        justify-content: start;
    }

    .v52-inquiry-polish .v49-search-form input[name="national_id"] {
        width: 100%;
        max-width: 360px;
        flex-basis: auto;
    }
}

/* في الجوال فقط يصبح الحقل بعرض الصفحة */
@media (max-width: 640px) {
    .v52-inquiry-polish .v49-search-form {
        grid-template-columns: 1fr;
        display: grid;
    }

    .v52-inquiry-polish .v49-search-form label,
    .v52-inquiry-polish .v49-search-form input[name="national_id"],
    .v52-inquiry-polish .v49-search-form button {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .v52-inquiry-polish .v49-search-form input[name="national_id"] {
        flex-basis: auto;
    }
}


/* ===== V54 Inquiry Center: tighter and calmer national ID search row ===== */

/* ضبط شريط الاستعلام ليكون أقصر وأكثر التصاقًا بصريًا */
.v52-inquiry-polish .v49-search-form {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: auto;
    max-width: 100%;
    flex-wrap: nowrap;
}

.v52-inquiry-polish .v49-search-form label {
    flex: 0 0 auto;
    min-width: 82px;
    margin: 0;
    color: var(--v49-text);
    font-size: 12.3px;
    white-space: nowrap;
}

.v52-inquiry-polish .v49-search-form input[name="national_id"] {
    flex: 0 0 320px;
    width: 320px;
    max-width: 320px;
    min-height: 36px;
    text-align: center;
    letter-spacing: .35px;
    direction: ltr;
}

.v52-inquiry-polish .v49-search-form button {
    flex: 0 0 auto;
    min-width: 84px;
    min-height: 36px;
}

/* جعل منطقة البحث هادئة بدون تمدد زائد */
.v52-inquiry-polish .v49-search-panel {
    padding: 9px 0 8px;
    display: block;
}

/* عند الشاشات المتوسطة يبقى الشريط محافظًا على شكله */
@media (max-width: 900px) {
    .v52-inquiry-polish .v49-search-form {
        display: inline-grid;
        grid-template-columns: auto minmax(260px, 320px) auto;
        justify-content: start;
        align-items: center;
        gap: 6px;
    }

    .v52-inquiry-polish .v49-search-form input[name="national_id"] {
        width: 100%;
        max-width: 320px;
        flex-basis: auto;
    }
}

/* في الجوال فقط يتحول إلى صفوف كاملة العرض */
@media (max-width: 640px) {
    .v52-inquiry-polish .v49-search-form {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .v52-inquiry-polish .v49-search-form label,
    .v52-inquiry-polish .v49-search-form input[name="national_id"],
    .v52-inquiry-polish .v49-search-form button {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .v52-inquiry-polish .v49-search-form input[name="national_id"] {
        flex-basis: auto;
    }
}


/* ===== V55 Application Detail: final nomination action ===== */

.v47-decision-buttons .final-action {
    background: #1f6f55;
    border-color: #1f6f55;
    color: #fff;
}

.v47-decision-buttons .final-action:hover {
    filter: brightness(.98);
}

.v47-decision-buttons .final-action.is-disabled {
    cursor: default;
    background: #edf8f2;
    border-color: #d5eadf;
    color: var(--success);
}

.v55-final-alert {
    background: #fffaf2;
    border-color: #ead8b1;
}

.v47-state-badges span.ok,
.v47-summary-strip strong.ok {
    font-weight: 500;
}

/* في حال زادت أزرار القرار بسبب زر الاعتماد النهائي */
@media (min-width: 1221px) {
    .v47-decision-buttons {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}


/* ===== V56 Application Detail: final nomination result card ===== */

.v56-final-result-card {
    grid-column: 1 / -1;
    padding: 11px 12px;
}

.v56-final-result-card.warn {
    background: #fffaf2;
    border-color: #ead8b1;
}

.v56-final-result-card.ok {
    background: #f8fcfa;
    border-color: #d5eadf;
}

.v56-final-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(220, 231, 235, .85);
}

.v56-final-head span,
.v56-approved-candidate span,
.v56-final-note span {
    display: block;
    color: var(--primary);
    font-size: 11.2px;
    line-height: 1.25;
    margin-bottom: 3px;
}

.v56-final-head h3 {
    margin: 0;
    color: var(--v47-text);
    font-size: 17px;
    line-height: 1.45;
}

.v56-final-head p {
    margin: 4px 0 0;
    color: var(--v47-muted);
    font-size: 12.4px;
    line-height: 1.65;
}

.v56-final-badge {
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    white-space: nowrap;
}

.v56-final-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v56-final-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v56-approved-candidate,
.v56-final-note {
    margin-top: 8px;
    border: 1px solid rgba(220, 231, 235, .9);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
    padding: 8px 10px;
}

.v56-approved-candidate strong {
    color: var(--v47-text);
    font-size: 14px;
    line-height: 1.5;
}

.v56-final-note p {
    margin: 0;
    color: var(--v47-text);
    font-size: 12.7px;
    line-height: 1.75;
}

@media (max-width: 720px) {
    .v56-final-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v56-final-badge {
        justify-content: center;
    }
}


/* ===== V56.1 Fix: spacing around final nomination result card ===== */

/* إضافة مسافة واضحة بين بطاقات البيانات وبطاقة نتيجة الترشيح النهائي */
.v47-data-grid {
    row-gap: 10px;
}

/* البطاقة المستقلة لا تكون ملتصقة بما قبلها أو بعدها */
.v56-final-result-card {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* في حال جاءت البطاقة بعد شبكة البيانات مباشرة */
.v47-data-grid + .v56-final-result-card {
    margin-top: 12px;
}

/* في حال جاءت بطاقة قرارات PDF بعدها مباشرة */
.v56-final-result-card + .v47-decisions-card {
    margin-top: 8px;
}

/* تهدئة التلاصق البصري داخل البطاقة نفسها */
.v56-final-head {
    margin-bottom: 2px;
}


/* ===== V57 Final Preview: show approved results after final nomination ===== */

body:has(.v57-final-preview-page) {
    font-weight: 400;
}

body:has(.v57-final-preview-page) strong,
body:has(.v57-final-preview-page) b,
body:has(.v57-final-preview-page) h1,
body:has(.v57-final-preview-page) h2,
body:has(.v57-final-preview-page) h3,
body:has(.v57-final-preview-page) h4 {
    font-weight: 500;
}

body:has(.v57-final-preview-page) .page,
body:has(.v57-final-preview-page) .container,
body:has(.v57-final-preview-page) main {
    max-width: min(1360px, calc(100% - 44px)) !important;
    width: min(1360px, calc(100% - 44px)) !important;
}

.v57-final-preview-page {
    --v57-border: #dce7eb;
    --v57-soft: #f7fafb;
    --v57-text: #253842;
    --v57-muted: #7c8b92;
    --v57-warn-bg: #fffaf2;
    --v57-warn-border: #ead8b1;
    --v57-ready-bg: #f8fcfa;
    --v57-ready-border: #d5eadf;
    --v57-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v57-board {
    background: #fff;
    border: 1px solid var(--v57-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v57-shadow);
}

.v57-hero,
.v57-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v57-hero {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--v57-border);
}

.v57-hero span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v57-hero h2,
.v57-card-head h3 {
    margin: 0;
    color: var(--v57-text);
    line-height: 1.45;
}

.v57-hero h2 {
    font-size: 22px;
}

.v57-card-head h3 {
    font-size: 16px;
}

.v57-hero p,
.v57-card-head p {
    margin: 4px 0 0;
    color: var(--v57-muted);
    font-size: 12.3px;
    line-height: 1.62;
}

.v57-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v57-hero-actions a,
.v57-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v57-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v57-hero-actions .is-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v57-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v57-border);
}

.v57-kpis div {
    min-height: 48px;
    border: 1px solid var(--v57-border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v57-kpis .ok {
    background: var(--v57-ready-bg);
    border-color: var(--v57-ready-border);
}

.v57-kpis .warn {
    background: var(--v57-warn-bg);
    border-color: var(--v57-warn-border);
}

.v57-kpis span {
    color: var(--v57-muted);
    font-size: 11.3px;
}

.v57-kpis strong {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.v57-rule {
    margin: 8px 0;
    border: 1px dashed var(--v57-border);
    border-radius: 13px;
    background: #fbfdfe;
    padding: 9px 10px;
}

.v57-rule strong {
    display: block;
    color: var(--v57-text);
    font-size: 13px;
    margin-bottom: 3px;
}

.v57-rule p {
    margin: 0;
    color: var(--v57-muted);
    font-size: 12.4px;
    line-height: 1.7;
}

.v57-table-card {
    border: 1px solid var(--v57-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
    margin-top: 8px;
}

.v57-card-head {
    margin-bottom: 8px;
}

.v57-chip,
.v57-badge {
    min-height: 22px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.6px;
    font-weight: 500;
    white-space: nowrap;
}

.v57-chip.ok,
.v57-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v57-chip.warn,
.v57-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v57-table-wrap {
    width: 100%;
    overflow-x: visible;
}

.v57-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v57-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v57-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v57-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v57-border);
    color: var(--v57-text);
    font-size: 12.2px;
    line-height: 1.45;
    vertical-align: middle;
}

.v57-table tbody tr:hover td {
    background: #fbfdfe;
}

.v57-table .name-cell strong {
    display: block;
    color: var(--v57-text);
    font-size: 12.6px;
    margin-bottom: 1px;
}

.v57-table .name-cell span {
    display: block;
    color: var(--v57-muted);
    font-size: 11.1px;
}

.v57-table .note-cell {
    color: #61727a;
    font-size: 11.9px;
}

.v57-table .empty {
    text-align: center;
    color: var(--v57-muted);
    padding: 18px 8px;
}

.v57-table tr.row-nominated td,
.v57-table tr.row-suggested td {
    background: #fbfefc;
}

.v57-table tr.row-not_nominated td {
    background: #fffdf8;
}

@media (max-width: 1220px) {
    .v57-hero,
    .v57-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v57-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v57-table-wrap {
        overflow-x: auto;
    }

    .v57-table {
        min-width: 980px;
    }
}

@media (max-width: 720px) {
    body:has(.v57-final-preview-page) .page,
    body:has(.v57-final-preview-page) .container,
    body:has(.v57-final-preview-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v57-kpis {
        grid-template-columns: 1fr;
    }
}


/* ===== V58 Final Preview: compact detail column ===== */

/* عمود التفصيل في الجداول يكون مختصرًا ومناسبًا للأعداد الكبيرة */
.v57-table .col-detail {
    width: 140px;
}

.v57-table .note-cell.compact {
    color: var(--primary-dark);
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v57-table .note-cell.compact::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    display: inline-block;
    margin-inline-end: 6px;
    opacity: .42;
    vertical-align: middle;
}

.v57-table tr.row-not_nominated .note-cell.compact {
    color: #8a5a00;
}

.v57-table tr.row-nominated .note-cell.compact,
.v57-table tr.row-suggested .note-cell.compact {
    color: var(--success);
}

/* تقليل الزحام في جدول طلبات لم يتم ترشيحها */
.v57-table-card + .v57-table-card {
    margin-top: 10px;
}

.v57-table tr.row-not_nominated td {
    background: #fffdf8;
}

/* عند كثرة الصفوف يكون الجدول أكثر قابلية للقراءة */
.v57-table td,
.v57-table th {
    overflow: hidden;
    text-overflow: ellipsis;
}

.v57-table .name-cell,
.v57-table .note-cell {
    overflow: visible;
}

@media (max-width: 1220px) {
    .v57-table .col-detail {
        width: auto;
    }

    .v57-table .note-cell.compact {
        white-space: nowrap;
    }
}


/* ===== V58.1 Final Preview: prevent text overlap in dense tables ===== */

/*
المشكلة:
في جدول المعاينة توجد أعمدة كثيرة، ومع table-layout: fixed كانت خلية المرشح والفرصة تتمدد بصريًا
وتتداخل مع الأعمدة المجاورة. هذا الإصلاح يمنع خروج النص من الخلية ويجعل القراءة أوضح.
*/

.v57-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
}

/* عرض أدنى مناسب حتى لا تنضغط الأعمدة عند كثرة البيانات */
.v57-table {
    table-layout: fixed;
    min-width: 1180px;
}

/* منع أي نص من الخروج على الخلايا المجاورة */
.v57-table th,
.v57-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* لا نترك خلايا الاسم أو التفصيل تتمدد خارج حدودها */
.v57-table .name-cell,
.v57-table .note-cell {
    overflow: hidden !important;
}

/* المرشح: سطران هادئان بدل تداخل الاسم مع الأعمدة */
.v57-table .name-cell strong {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.45;
}

.v57-table .name-cell span {
    display: block;
    max-width: 100%;
    direction: ltr;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* الخلايا النصية الطويلة مثل الفرصة والقطاع */
.v57-table td:nth-child(3),
.v57-table td:nth-child(4) {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

/* ضبط عرض أعمدة الجدول الأول ذي الأعمدة الكثيرة */
.v57-table th:nth-child(1),
.v57-table td:nth-child(1) {
    width: 42px;
}

.v57-table th:nth-child(2),
.v57-table td:nth-child(2) {
    width: 210px;
}

.v57-table th:nth-child(3),
.v57-table td:nth-child(3) {
    width: 210px;
}

.v57-table th:nth-child(4),
.v57-table td:nth-child(4) {
    width: 150px;
}

.v57-table th:nth-child(5),
.v57-table td:nth-child(5) {
    width: 100px;
}

.v57-table th:nth-child(6),
.v57-table td:nth-child(6),
.v57-table th:nth-child(7),
.v57-table td:nth-child(7),
.v57-table th:nth-child(8),
.v57-table td:nth-child(8) {
    width: 86px;
    text-align: center;
}

.v57-table th:nth-child(9),
.v57-table td:nth-child(9) {
    width: 120px;
}

.v57-table th:nth-child(10),
.v57-table td:nth-child(10) {
    width: 140px;
}

.v57-table th:nth-child(11),
.v57-table td:nth-child(11) {
    width: 105px;
    text-align: center;
}

/* جدول طلبات لم يتم ترشيحها أقل أعمدة، فيأخذ الاسم والفرصة مساحة أوضح */
.v57-table-card + .v57-table-card .v57-table {
    min-width: 980px;
}

.v57-table-card + .v57-table-card .v57-table th:nth-child(2),
.v57-table-card + .v57-table-card .v57-table td:nth-child(2) {
    width: 240px;
}

.v57-table-card + .v57-table-card .v57-table th:nth-child(3),
.v57-table-card + .v57-table-card .v57-table td:nth-child(3) {
    width: 260px;
}

.v57-table-card + .v57-table-card .v57-table th:nth-child(6),
.v57-table-card + .v57-table-card .v57-table td:nth-child(6) {
    width: 150px;
}

/* جعل زر فتح الطلب ثابتًا ولا يزاحم النصوص */
.v57-action-link {
    min-width: 82px;
}

/* في الشاشات الكبيرة جدًا نسمح بعرض أكبر دون تلاصق */
@media (min-width: 1440px) {
    .v57-table {
        min-width: 1240px;
    }
}


/* ===== V58.2 Final Preview: remove horizontal scrollbar ===== */

/*
تم تخفيف أعمدة جدول المعاينة من القالب، وهذه القواعد تمنع ظهور شريط التمرير الأفقي
مع الحفاظ على عدم تداخل النصوص.
*/

.v57-table-wrap {
    overflow-x: hidden !important;
    overflow-y: visible;
}

.v57-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
}

/* توزيع أعمدة الجدول المختصر */
.v57-table .col-num,
.v57-table th.col-num,
.v57-table td:first-child {
    width: 42px;
}

.v57-table .col-candidate {
    width: 22%;
}

.v57-table .col-opportunity {
    width: 24%;
}

.v57-table .col-sector {
    width: 15%;
}

.v57-table .col-total {
    width: 80px;
    text-align: center;
}

.v57-table .col-status {
    width: 125px;
    text-align: center;
}

.v57-table .col-detail {
    width: 145px;
}

.v57-table .col-action {
    width: 105px;
    text-align: center;
}

/* منع التداخل بدون Scroll */
.v57-table th,
.v57-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* أسماء المرشحين والفرص تلتف داخل الخلية بدل التمدد */
.v57-table .name-cell,
.v57-table td:nth-child(3),
.v57-table td:nth-child(4) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.45;
}

.v57-table .name-cell strong {
    white-space: normal;
    overflow-wrap: anywhere;
}

.v57-table .name-cell span {
    direction: ltr;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* خلايا الحالة والتفصيل والإجراء تكون مختصرة */
.v57-table .note-cell.compact,
.v57-table td:nth-last-child(2),
.v57-table td:last-child {
    white-space: nowrap;
}

/* جدول طلبات لم يتم ترشيحها لا يحتاج توزيع جدول المعاينة السابق */
.v57-table-card + .v57-table-card .v57-table .col-candidate {
    width: 24%;
}

.v57-table-card + .v57-table-card .v57-table .col-opportunity {
    width: 28%;
}

.v57-table-card + .v57-table-card .v57-table .col-detail {
    width: 155px;
}

/* تقليل الحشو قليلًا حتى يستوعب الجدول بدون تمرير */
.v57-table th,
.v57-table td {
    padding-inline: 6px;
}

/* في الشاشات الصغيرة جدًا يصبح التمرير مقبولًا بدل تكسير الجدول */
@media (max-width: 900px) {
    .v57-table-wrap {
        overflow-x: auto !important;
    }

    .v57-table {
        min-width: 860px !important;
    }
}


/* ===== V59 Final Preview: opportunity filter ===== */

.v59-filter-card {
    margin: 8px 0;
    border: 1px solid var(--v57-border);
    border-radius: 14px;
    background: #fbfdfe;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.v59-filter-card strong {
    display: block;
    color: var(--v57-text);
    font-size: 13.2px;
    margin-bottom: 3px;
}

.v59-filter-card p {
    margin: 0;
    color: var(--v57-muted);
    font-size: 12.2px;
    line-height: 1.65;
}

.v59-filter-form {
    display: grid;
    grid-template-columns: auto minmax(280px, 520px) auto auto;
    gap: 7px;
    align-items: center;
}

.v59-filter-form label {
    color: var(--v57-text);
    font-size: 12.2px;
    white-space: nowrap;
}

.v59-filter-form select {
    min-height: 34px;
    border: 1px solid var(--v57-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v57-text);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12.4px;
    outline: none;
}

.v59-filter-form button,
.v59-filter-form a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v57-border);
    border-radius: 10px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 6px 11px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.v59-filter-form button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v59-opportunity-summary {
    margin: 8px 0;
    display: grid;
    grid-template-columns: 2fr 1.3fr .7fr .9fr .9fr;
    gap: 7px;
}

.v59-opportunity-summary div {
    border: 1px solid var(--v57-border);
    border-radius: 12px;
    background: #fff;
    min-height: 46px;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v59-opportunity-summary span {
    color: var(--v57-muted);
    font-size: 11.2px;
    line-height: 1.25;
}

.v59-opportunity-summary strong {
    color: var(--primary-dark);
    font-size: 13.2px;
    line-height: 1.45;
}

@media (max-width: 1100px) {
    .v59-filter-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .v59-filter-form {
        grid-template-columns: 1fr;
    }

    .v59-opportunity-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .v59-opportunity-summary {
        grid-template-columns: 1fr;
    }
}


/* ===== V59.1 Final Preview: column alignment ===== */

/*
ضبط نهائي لمحاذاة أعمدة جدول معاينة الترشيح النهائي.
المهم هنا أن رقم الدرجة يظهر تحت "المجموع" بوضوح، دون انزياح بصري.
*/

.v57-table {
    width: 100% !important;
    table-layout: fixed;
    min-width: 0 !important;
}

/* تطبيق العرض على th و td معًا بعد إضافة class للخلايا */
.v57-table th.col-num,
.v57-table td.col-num {
    width: 42px;
    text-align: center;
}

.v57-table th.col-candidate,
.v57-table td.col-candidate {
    width: 24%;
}

.v57-table th.col-opportunity,
.v57-table td.col-opportunity {
    width: 25%;
}

.v57-table th.col-sector,
.v57-table td.col-sector {
    width: 14%;
}

.v57-table th.col-total,
.v57-table td.col-total {
    width: 88px;
    text-align: center !important;
}

.v57-table th.col-status,
.v57-table td.col-status {
    width: 124px;
    text-align: center !important;
}

.v57-table th.col-detail,
.v57-table td.col-detail {
    width: 140px;
    text-align: center !important;
}

.v57-table th.col-action,
.v57-table td.col-action {
    width: 104px;
    text-align: center !important;
}

/* المجموع يظهر كرقم مستقل واضح في منتصف العمود */
.v57-table td.col-total strong {
    display: inline-flex;
    min-width: 64px;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    color: var(--primary-dark);
}

/* منع امتداد النصوص الطويلة على عمود المجموع */
.v57-table td.col-candidate,
.v57-table td.col-opportunity,
.v57-table td.col-sector {
    overflow: hidden;
    text-overflow: ellipsis;
}

.v57-table td.col-opportunity,
.v57-table td.col-sector {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.v57-table td.col-candidate strong {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.v57-table td.col-candidate span {
    display: block;
    max-width: 100%;
    direction: ltr;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--v57-muted);
}

/* تقليل الحشو حتى لا ينضغط الجدول */
.v57-table th,
.v57-table td {
    padding-inline: 6px;
}

/* جدول طلبات لم يتم ترشيحها: توزيع أعرض قليلًا للمرشح والفرصة */
.v57-table-card + .v57-table-card .v57-table th.col-candidate,
.v57-table-card + .v57-table-card .v57-table td.col-candidate {
    width: 25%;
}

.v57-table-card + .v57-table-card .v57-table th.col-opportunity,
.v57-table-card + .v57-table-card .v57-table td.col-opportunity {
    width: 30%;
}

.v57-table-card + .v57-table-card .v57-table th.col-detail,
.v57-table-card + .v57-table-card .v57-table td.col-detail {
    width: 150px;
}

/* لا يظهر شريط تمرير في العرض العادي */
.v57-table-wrap {
    overflow-x: hidden !important;
}

/* في الشاشات الصغيرة فقط يسمح بالتمرير بدل تكسير الجدول */
@media (max-width: 900px) {
    .v57-table-wrap {
        overflow-x: auto !important;
    }

    .v57-table {
        min-width: 860px !important;
    }
}


/* ===== V60 Final Preview: opportunity summary overview ===== */

/* في وضع الملخص لا تعرض تفاصيل المرشحين لكل الفرص دفعة واحدة */
.v60-summary-card {
    margin-top: 8px;
}

/* جدول ملخص الفرص */
.v60-summary-table th.col-opportunity,
.v60-summary-table td.col-opportunity {
    width: 23%;
}

.v60-summary-table th.col-sector,
.v60-summary-table td.col-sector {
    width: 14%;
}

.v60-summary-table th.col-candidate,
.v60-summary-table td.col-candidate {
    width: 22%;
}

.v60-summary-table th.col-total,
.v60-summary-table td.col-total {
    width: 82px;
    text-align: center !important;
}

.v60-summary-table th.col-status,
.v60-summary-table td.col-status {
    width: 125px;
    text-align: center !important;
}

.v60-summary-table th.col-count,
.v60-summary-table td.col-count {
    width: 95px;
    text-align: center !important;
}

.v60-summary-table th.col-action,
.v60-summary-table td.col-action {
    width: 115px;
    text-align: center !important;
}

.v60-summary-table td.col-opportunity,
.v60-summary-table td.col-sector {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.v60-count-badge {
    min-width: 34px;
    min-height: 23px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.7px;
    font-weight: 500;
}

.v60-count-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

/* في وضع ملخص الفرص نمنع التمرير الأفقي في الشاشات العادية */
.v60-summary-table {
    min-width: 0 !important;
    width: 100% !important;
}

/* تحسين نص المرشح النهائي إذا لم يوجد مرشح */
.v60-summary-table .name-cell strong {
    color: var(--v57-text);
}

.v60-summary-table .name-cell strong:empty::after {
    content: "-";
}

/* بطاقة الفلتر تصبح أوضح في وضع الملخص */
.v60-final-summary-page .v59-filter-card {
    background: #fff;
}

/* الشاشات الصغيرة */
@media (max-width: 1000px) {
    .v60-summary-table {
        min-width: 920px !important;
    }

    .v60-summary-card .v57-table-wrap {
        overflow-x: auto !important;
    }
}


/* ===== V61 Inquiry Center: POST privacy and cleaner result ===== */

/* إظهار ملاحظة الخصوصية بشكل خفيف وغير مزعج */
.v61-inquiry-secure .v61-privacy-note {
    margin-top: 6px;
    color: #7c8b92;
    font-size: 11.2px;
    line-height: 1.5;
}

/* بعد حذف بطاقة النتيجة المختصرة، يصبح ملخص النتيجة أكثر هدوءًا */
.v61-inquiry-secure .v49-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* في حال كانت القاعدة السابقة تفرض 6 خلايا */
.v61-inquiry-secure .v49-summary-grid > div {
    min-width: 0;
}

/* الخلاصة للرد تكون أوضح دون تكرار بصري */
.v61-inquiry-secure .v52-brief-reply {
    margin-top: 8px;
    margin-bottom: 8px;
}

.v61-inquiry-secure .v52-brief-reply span {
    color: var(--primary);
    font-size: 11.4px;
}

.v61-inquiry-secure .v52-brief-reply strong {
    font-size: 14px;
    line-height: 1.7;
}

/* ضبط حقل السجل المدني بعد التحويل إلى POST */
.v61-inquiry-secure .v49-search-form input[name="national_id"] {
    direction: ltr;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* منع أي تمدد زائد بعد الرسالة الصغيرة */
.v61-inquiry-secure .v49-search-panel {
    align-items: start;
}

@media (max-width: 900px) {
    .v61-inquiry-secure .v49-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .v61-inquiry-secure .v49-summary-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== V62 Inquiry Center: clear response-first layout ===== */

/*
الهدف:
موظف الاستعلام يرى أولًا قرار الرد، ثم السبب، ثم بيانات داعمة مختصرة،
ثم صيغة الرد الجاهزة مع زر النسخ.
*/

.v62-board {
    padding: 12px;
}

.v62-hero {
    align-items: center;
    padding-bottom: 10px;
}

.v62-hero h2 {
    margin-bottom: 0;
}

/* شريط البحث */
.v62-search-panel {
    padding: 10px 0 11px;
    border-bottom: 1px solid var(--v49-border);
}

.v62-search-form {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: nowrap;
}

.v62-search-form label {
    min-width: 82px;
    color: var(--v49-text);
    font-size: 12.4px;
    white-space: nowrap;
}

.v62-search-form input[name="national_id"] {
    width: 320px;
    max-width: 320px;
    min-height: 36px;
    direction: ltr;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: .35px;
}

.v62-search-form button {
    min-width: 86px;
    min-height: 36px;
}

/* بطاقة قرار الرد */
.v62-decision-card {
    margin-top: 10px;
    border: 1px solid var(--v49-border);
    border-radius: 16px;
    background: #fff;
    padding: 11px;
    box-shadow: 0 5px 14px rgba(22, 50, 65, 0.028);
}

.v62-decision-card.ok {
    background: #f8fcfa;
    border-color: #d5eadf;
}

.v62-decision-card.warn {
    background: #fffaf2;
    border-color: #ead8b1;
}

.v62-decision-card.neutral {
    background: #fbfdfe;
}

.v62-decision-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(220, 231, 235, .85);
}

.v62-decision-main span,
.v62-support-grid span,
.v62-reply-card span {
    display: block;
    color: var(--primary);
    font-size: 11.3px;
    line-height: 1.25;
    margin-bottom: 3px;
}

.v62-decision-main h3 {
    margin: 0;
    color: var(--v49-text);
    font-size: 23px;
    line-height: 1.45;
    font-weight: 500;
}

.v62-decision-main p {
    margin: 5px 0 0;
    color: #61727a;
    font-size: 13px;
    line-height: 1.75;
}

.v62-result-badge {
    min-height: 34px;
    min-width: 118px;
    border-radius: 999px;
    padding: 5px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.6px;
    font-weight: 500;
    white-space: nowrap;
}

.v62-result-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v62-result-badge.warn {
    background: #fff1d9;
    color: #8a5a00;
}

.v62-result-badge.neutral {
    background: #edf5f7;
    color: var(--primary-dark);
}

/* البيانات الداعمة */
.v62-support-grid {
    margin-top: 9px;
    display: grid;
    grid-template-columns: 1.5fr 1.7fr 1fr .85fr .85fr;
    gap: 7px;
}

.v62-support-grid > div {
    border: 1px solid rgba(220, 231, 235, .9);
    border-radius: 12px;
    background: rgba(255, 255, 255, .78);
    padding: 8px 9px;
    min-height: 56px;
    display: grid;
    align-content: center;
}

.v62-support-grid strong {
    color: var(--v49-text);
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
}

.v62-support-grid small {
    display: block;
    margin-top: 1px;
    color: #7c8b92;
    font-size: 11.2px;
    direction: ltr;
    text-align: right;
}

.v62-support-grid strong.ok {
    color: var(--success);
}

.v62-support-grid strong.warn {
    color: #8a5a00;
}

/* صيغة الرد */
.v62-reply-card {
    margin-top: 9px;
    border: 1px solid rgba(220, 231, 235, .95);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.v62-reply-card p {
    margin: 0;
    color: var(--v49-text);
    font-size: 13px;
    line-height: 1.85;
}

.v62-reply-card button {
    min-height: 38px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

/* إخفاء مكونات V52 القديمة إن بقيت من كاش أو دمج سابق */
.v62-inquiry-clear .v52-brief-reply,
.v62-inquiry-clear .v49-reason-card,
.v62-inquiry-clear .v49-reply-box,
.v62-inquiry-clear .v49-summary-grid {
    display: none;
}

/* تجاوب */
@media (max-width: 1100px) {
    .v62-support-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v62-reply-card {
        grid-template-columns: 1fr;
    }

    .v62-reply-card button {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .v62-decision-main {
        flex-direction: column;
        align-items: stretch;
    }

    .v62-result-badge {
        width: 100%;
    }

    .v62-search-form {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .v62-search-form label,
    .v62-search-form input[name="national_id"],
    .v62-search-form button {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .v62-support-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== V63 Stage Detail: work center ===== */

body:has(.v63-stage-page) {
    font-weight: 400;
}

body:has(.v63-stage-page) strong,
body:has(.v63-stage-page) b,
body:has(.v63-stage-page) h1,
body:has(.v63-stage-page) h2,
body:has(.v63-stage-page) h3,
body:has(.v63-stage-page) h4 {
    font-weight: 500;
}

body:has(.v63-stage-page) .page,
body:has(.v63-stage-page) .container,
body:has(.v63-stage-page) main {
    max-width: min(1420px, calc(100% - 44px)) !important;
    width: min(1420px, calc(100% - 44px)) !important;
}

.v63-stage-page {
    --v63-border: #dce7eb;
    --v63-soft: #f7fafb;
    --v63-text: #253842;
    --v63-muted: #7c8b92;
    --v63-warn-bg: #fffaf2;
    --v63-warn-border: #ead8b1;
    --v63-ok-bg: #f8fcfa;
    --v63-ok-border: #d5eadf;
    --v63-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v63-board {
    background: #fff;
    border: 1px solid var(--v63-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v63-shadow);
}

/* Header */
.v63-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--v63-border);
}

.v63-hero span,
.v63-content-head span,
.v63-priority-head span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v63-hero h2 {
    margin: 0;
    color: var(--v63-text);
    font-size: 22px;
    line-height: 1.45;
}

.v63-hero p {
    margin: 4px 0 0;
    color: var(--v63-muted);
    font-size: 12.3px;
    line-height: 1.6;
}

.v63-hero p b {
    display: inline-flex;
    margin-inline-start: 8px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    padding: 2px 9px;
    font-size: 11.3px;
}

.v63-hero-actions,
.v63-priority-actions,
.v63-content-tabs,
.v63-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v63-hero-actions a,
.v63-priority-actions a,
.v63-content-tabs a,
.v63-toolbar a,
.v63-action-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v63-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 9px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

.v63-hero-actions .is-primary,
.v63-priority-actions .is-primary,
.v63-content-tabs .active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* KPIs */
.v63-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v63-border);
}

.v63-kpis a {
    min-height: 49px;
    border: 1px solid var(--v63-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v63-kpis a.ok {
    background: var(--v63-ok-bg);
    border-color: var(--v63-ok-border);
}

.v63-kpis a.warn {
    background: var(--v63-warn-bg);
    border-color: var(--v63-warn-border);
}

.v63-kpis span,
.v63-mini-actions span,
.v63-priority-details span {
    color: var(--v63-muted);
    font-size: 11.3px;
}

.v63-kpis strong {
    color: var(--primary-dark);
    font-size: 19px;
    line-height: 1;
}

/* Work center */
.v63-work-center {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, .75fr);
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px solid var(--v63-border);
}

.v63-priority-card,
.v63-next-actions {
    border: 1px solid var(--v63-border);
    border-radius: 15px;
    background: #fff;
    padding: 10px;
}

.v63-priority-card.warn {
    background: var(--v63-warn-bg);
    border-color: var(--v63-warn-border);
}

.v63-priority-card.ok {
    background: var(--v63-ok-bg);
    border-color: var(--v63-ok-border);
}

.v63-priority-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.v63-priority-head h3 {
    margin: 0;
    color: var(--v63-text);
    font-size: 18px;
    line-height: 1.5;
}

.v63-priority-head p {
    margin: 4px 0 0;
    color: #61727a;
    font-size: 12.6px;
    line-height: 1.75;
}

.v63-priority-head > strong {
    min-width: 62px;
    min-height: 54px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .68);
    border: 1px solid rgba(220, 231, 235, .9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 24px;
    font-variant-numeric: tabular-nums;
}

.v63-priority-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.v63-priority-details a {
    border: 1px solid rgba(220, 231, 235, .9);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
    padding: 8px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.v63-priority-details b {
    color: var(--primary-dark);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.v63-priority-actions {
    margin-top: 10px;
}

.v63-next-actions h3 {
    margin: 0 0 8px;
    color: var(--v63-text);
    font-size: 14px;
}

.v63-next-actions a {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--v63-border);
    border-radius: 12px;
    padding: 7px;
    background: #fbfdfe;
}

.v63-next-actions a + a {
    margin-top: 6px;
}

.v63-next-actions a > span {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
}

.v63-next-actions strong {
    display: block;
    color: var(--v63-text);
    font-size: 12.7px;
}

.v63-next-actions small {
    display: block;
    color: var(--v63-muted);
    font-size: 11.3px;
    margin-top: 1px;
}

/* Mini actions */
.v63-mini-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v63-border);
}

.v63-mini-actions a {
    border: 1px solid var(--v63-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.v63-mini-actions strong {
    color: var(--primary-dark);
    font-size: 13px;
}

/* Content */
.v63-content-panel {
    margin-top: 8px;
}

.v63-content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.v63-content-head h3 {
    margin: 0;
    color: var(--v63-text);
    font-size: 16px;
}

.v63-content-head p {
    margin: 3px 0 0;
    color: var(--v63-muted);
    font-size: 12.2px;
    line-height: 1.6;
}

.v63-toolbar {
    justify-content: space-between;
    border: 1px solid var(--v63-border);
    border-radius: 12px;
    background: #fbfdfe;
    padding: 6px 8px;
    margin-bottom: 7px;
}

.v63-toolbar span {
    color: var(--v63-muted);
    font-size: 11.8px;
}

/* Tables */
.v63-table-wrap {
    width: 100%;
    overflow-x: hidden;
}

.v63-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v63-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v63-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v63-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v63-border);
    color: var(--v63-text);
    font-size: 12.2px;
    line-height: 1.45;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v63-table .col-name {
    width: 32%;
}

.v63-table .col-action {
    width: 115px;
    text-align: center;
}

.v63-table .name-cell strong {
    display: block;
    color: var(--v63-text);
    font-size: 12.7px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.v63-table .name-cell span {
    display: block;
    color: var(--v63-muted);
    font-size: 11.1px;
    direction: ltr;
    text-align: right;
    white-space: nowrap;
}

.v63-table .num-cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.v63-badge {
    min-height: 22px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.6px;
    font-weight: 500;
    white-space: nowrap;
}

.v63-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v63-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v63-badge.strong {
    background: #edf5f7;
    color: var(--primary-dark);
}

.v63-table .empty {
    text-align: center;
    color: var(--v63-muted);
    padding: 18px 8px;
}

.v63-table tr.needs-action td {
    background: #fffdf8;
}

/* Responsive */
@media (max-width: 1100px) {
    .v63-hero,
    .v63-content-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v63-kpis,
    .v63-mini-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v63-work-center {
        grid-template-columns: 1fr;
    }

    .v63-table-wrap {
        overflow-x: auto;
    }

    .v63-table {
        min-width: 900px;
    }
}

@media (max-width: 720px) {
    body:has(.v63-stage-page) .page,
    body:has(.v63-stage-page) .container,
    body:has(.v63-stage-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v63-kpis,
    .v63-mini-actions,
    .v63-priority-details {
        grid-template-columns: 1fr;
    }

    .v63-priority-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v63-priority-head > strong {
        width: 100%;
    }
}


/* ===== V64 Stage Detail: visual refinement for work center ===== */

/*
الهدف:
تقليل الفراغ داخل بطاقة "الأولوية الآن"، وتهدئة خطوات العمل،
وتحسين التوازن بين يمين الصفحة ويسارها دون تغيير المنطق أو القوالب.
*/

/* منع تمدد بطاقة الأولوية بطول بطاقة خطوات العمل */
.v63-work-center {
    align-items: start;
    grid-template-columns: minmax(0, 2.05fr) minmax(260px, .62fr);
    gap: 8px;
    padding: 8px 0;
}

/* بطاقة الأولوية تصبح أقصر وأكثر تركيزًا */
.v63-priority-card {
    align-self: start;
    padding: 9px 10px;
    min-height: 0;
}

.v63-priority-card.warn,
.v63-priority-card.ok,
.v63-priority-card.neutral {
    min-height: 0;
}

/* رأس بطاقة الأولوية */
.v63-priority-head {
    align-items: center;
    gap: 12px;
}

.v63-priority-head h3 {
    font-size: 16.6px;
    line-height: 1.45;
}

.v63-priority-head p {
    margin-top: 3px;
    font-size: 12.2px;
    line-height: 1.65;
    max-width: 760px;
}

.v63-priority-head > strong {
    min-width: 54px;
    min-height: 46px;
    border-radius: 13px;
    font-size: 22px;
}

/* أرقام الأولوية في صف واحد أوضح وأقل ارتفاعًا */
.v63-priority-details {
    margin-top: 8px;
    gap: 6px;
}

.v63-priority-details a {
    min-height: 38px;
    padding: 6px 8px;
    border-radius: 11px;
}

.v63-priority-details span {
    font-size: 11.2px;
}

.v63-priority-details b {
    font-size: 15px;
}

/* أزرار العمل داخل بطاقة الأولوية */
.v63-priority-actions {
    margin-top: 8px;
    justify-content: flex-start;
}

.v63-priority-actions a {
    min-height: 29px;
    padding: 5px 10px;
    font-size: 11.7px;
}

/* خطوات العمل تصبح أهدأ وأضيق */
.v63-next-actions {
    align-self: start;
    padding: 8px;
}

.v63-next-actions h3 {
    margin-bottom: 7px;
    font-size: 13.4px;
}

.v63-next-actions a {
    grid-template-columns: 24px 1fr;
    gap: 7px;
    padding: 6px;
    border-radius: 11px;
}

.v63-next-actions a + a {
    margin-top: 5px;
}

.v63-next-actions a > span {
    width: 24px;
    height: 24px;
    font-size: 11px;
}

.v63-next-actions strong {
    font-size: 12.2px;
}

.v63-next-actions small {
    font-size: 10.9px;
}

/* تقليل ارتفاع المؤشرات والبطاقات المساعدة */
.v63-kpis {
    gap: 6px;
    padding: 7px 0;
}

.v63-kpis a {
    min-height: 45px;
    padding: 6px 8px;
}

.v63-kpis strong {
    font-size: 18px;
}

.v63-mini-actions {
    gap: 6px;
    padding: 7px 0;
}

.v63-mini-actions a {
    padding: 6px 8px;
    min-height: 36px;
}

/* تهدئة منطقة البيانات السفلية */
.v63-content-panel {
    margin-top: 7px;
}

.v63-content-head {
    margin-bottom: 7px;
}

.v63-toolbar {
    padding: 5px 8px;
    margin-bottom: 6px;
}

.v63-table th {
    padding-block: 6px;
}

.v63-table td {
    padding-block: 6px;
}

/* في الشاشات المتوسطة تبقى الأولوية فوق خطوات العمل */
@media (max-width: 1100px) {
    .v63-work-center {
        grid-template-columns: 1fr;
    }

    .v63-next-actions {
        width: 100%;
    }
}

/* في الجوال تعود العناصر للتكدس الهادئ */
@media (max-width: 720px) {
    .v63-priority-head {
        align-items: stretch;
    }

    .v63-priority-head > strong {
        min-height: 42px;
    }
}


/* ===== V65 Stage Detail: compact work center + horizontal workflow ===== */

/*
الهدف:
- حذف مربع الرقم الكبير من بطاقة الأولوية.
- جعل الرقم داخل العنوان فقط.
- تحويل خطوات العمل من عمود جانبي إلى شريط أفقي.
- تقليل ارتفاع بطاقة الأولوية.
- إبقاء الجداول كما هي.
*/

/* مركز العمل يصبح عمودًا: شريط خطوات ثم بطاقة الأولوية */
.v65-stage-page .v63-work-center {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 7px 0;
    align-items: start;
}

/* شريط خطوات العمل */
.v65-stage-page .v63-next-actions {
    padding: 7px;
    border-radius: 14px;
    background: #fbfdfe;
    display: grid;
    grid-template-columns: auto repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 6px;
}

.v65-stage-page .v63-next-actions h3 {
    margin: 0;
    padding-inline: 4px 8px;
    font-size: 12.8px;
    color: var(--v63-text);
    white-space: nowrap;
}

.v65-stage-page .v63-next-actions a {
    margin: 0 !important;
    min-height: 38px;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 7px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 11px;
    background: #fff;
}

.v65-stage-page .v63-next-actions a > span {
    width: 24px;
    height: 24px;
    font-size: 11px;
}

.v65-stage-page .v63-next-actions strong {
    font-size: 12px;
    line-height: 1.25;
}

.v65-stage-page .v63-next-actions small {
    font-size: 10.7px;
    line-height: 1.25;
}

/* بطاقة الأولوية بدون مربع الرقم الكبير */
.v65-stage-page .v63-priority-card {
    padding: 9px 10px;
    min-height: 0;
}

.v65-stage-page .v63-priority-head {
    display: block;
}

.v65-stage-page .v63-priority-head > strong {
    display: none !important;
}

.v65-stage-page .v63-priority-head h3 {
    font-size: 16.3px;
    line-height: 1.42;
}

.v65-stage-page .v63-priority-head p {
    margin-top: 3px;
    max-width: none;
    font-size: 12.1px;
    line-height: 1.58;
}

/* أرقام الأولوية تصبح صفًا مضغوطًا واضحًا */
.v65-stage-page .v63-priority-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
}

.v65-stage-page .v63-priority-details a {
    min-height: 35px;
    padding: 5px 8px;
    border-radius: 10px;
}

.v65-stage-page .v63-priority-details b {
    font-size: 14.4px;
}

.v65-stage-page .v63-priority-actions {
    margin-top: 7px;
}

.v65-stage-page .v63-priority-actions a {
    min-height: 28px;
    padding: 5px 10px;
}

/* المؤشرات العلوية تبقى هادئة */
.v65-stage-page .v63-kpis a {
    min-height: 43px;
}

.v65-stage-page .v63-mini-actions a {
    min-height: 34px;
}

/* تقليل الفراغ قبل الجداول */
.v65-stage-page .v63-content-panel {
    margin-top: 6px;
}

/* للشاشات المتوسطة يتحول شريط الخطوات إلى صفين بدل الازدحام */
@media (max-width: 1180px) {
    .v65-stage-page .v63-next-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v65-stage-page .v63-next-actions h3 {
        grid-column: 1 / -1;
        padding-bottom: 2px;
    }
}

/* للجوال */
@media (max-width: 720px) {
    .v65-stage-page .v63-next-actions,
    .v65-stage-page .v63-priority-details {
        grid-template-columns: 1fr;
    }

    .v65-stage-page .v63-next-actions h3 {
        white-space: normal;
    }
}


/* ===== V66 Stage Applications: active opportunity filter clarity ===== */

/*
الهدف:
عند الدخول من زر "طلبات الفرصة" أو وجود q باسم فرصة، تظهر بطاقة واضحة:
الفلتر الحالي / طلبات فرصة / مسح فلتر الفرصة.
*/

.v66-applications .v46-hero h2 {
    line-height: 1.5;
}

.v66-active-filter {
    margin: 8px 0 9px;
    border: 1px solid #dce7eb;
    border-radius: 14px;
    background: #fbfdfe;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v66-active-filter__main span {
    display: block;
    color: var(--primary);
    font-size: 10.9px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v66-active-filter__main h3 {
    margin: 0;
    color: #253842;
    font-size: 15.5px;
    line-height: 1.45;
    font-weight: 500;
}

.v66-active-filter__main p {
    margin: 3px 0 0;
    color: #7c8b92;
    font-size: 12.1px;
    line-height: 1.6;
}

.v66-active-filter__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.v66-active-filter__actions a {
    min-height: 31px;
    border: 1px solid #dce7eb;
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
}

/* جعل بطاقة سجل الطلبات تتصل منطقيًا ببطاقة الفلتر */
.v66-applications .v46-table-panel {
    margin-top: 0;
}

.v66-applications .v46-panel-head h3 {
    font-size: 15.5px;
}

.v66-applications .v46-panel-head p {
    color: #7c8b92;
}

/* تمييز أن نتائج الجدول محصورة بفلتر */
.v66-applications .v66-active-filter + .v46-table-panel {
    border-top-color: #cfdfe5;
}

/* تهدئة تكرار الفلاتر عند وجود فلتر فرصة */
.v66-applications .v46-tools {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .v66-active-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .v66-active-filter__actions a {
        width: 100%;
    }
}


/* ===== V67 Score Documentation: committees and audit ===== */

/* بطاقة توثيق الدرجات في ملف الطلب */
.v67-score-doc-card {
    grid-column: 1 / -1;
}

.v67-doc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 9px;
}

.v67-doc-block {
    border: 1px solid rgba(220, 231, 235, .92);
    border-radius: 13px;
    background: #fbfdfe;
    padding: 10px;
}

.v67-doc-block > span {
    display: block;
    color: var(--primary);
    font-size: 11.2px;
    line-height: 1.25;
    margin-bottom: 4px;
}

.v67-doc-block > strong {
    display: block;
    color: var(--v47-text);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
}

.v67-doc-block > strong.ok {
    color: var(--success);
}

.v67-doc-block > strong.warn {
    color: #8a5a00;
}

.v67-doc-block small {
    display: block;
    margin-top: 3px;
    color: var(--v47-muted);
    font-size: 11.5px;
    line-height: 1.55;
}

.v67-members-list {
    list-style: none;
    margin: 9px 0 0;
    padding: 0;
    display: grid;
    gap: 5px;
}

.v67-members-list li {
    border: 1px solid rgba(220, 231, 235, .75);
    border-radius: 10px;
    background: #fff;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.v67-members-list b {
    color: var(--v47-text);
    font-size: 12.4px;
    font-weight: 500;
}

.v67-members-list em {
    color: var(--v47-muted);
    font-size: 11.4px;
    font-style: normal;
}

.v67-audit-list {
    margin: 8px 0 0;
    padding: 0;
}

.v67-audit-list div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px;
    border-top: 1px solid rgba(220, 231, 235, .85);
    padding: 7px 0;
}

.v67-audit-list dt {
    color: var(--v47-muted);
    font-size: 11.6px;
}

.v67-audit-list dd {
    margin: 0;
    color: var(--v47-text);
    font-size: 12.3px;
    line-height: 1.55;
}

/* شارة التدقيق في سجل الطلبات */
.v67-score-audit-badge {
    margin-top: 3px;
    min-height: 20px;
    border-radius: 999px;
    padding: 1px 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10.8px;
    font-style: normal;
    font-weight: 500;
    white-space: nowrap;
}

.v67-score-audit-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v67-score-audit-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v67-score-audit-badge.neutral {
    background: #edf5f7;
    color: var(--primary-dark);
}

@media (max-width: 900px) {
    .v67-doc-grid {
        grid-template-columns: 1fr;
    }

    .v67-members-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .v67-audit-list div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}


/* ===== V67.1 wording refinement ===== */

/* توضيح أن الاختيار للتوثيق فقط وليس لإدخال الدرجة من اللجنة */
.v67-doc-block > small {
    color: #72848c;
}

.v67-score-audit-badge.neutral {
    color: #49636d;
}


/* ===== V68 Dashboard management: committees and score reviewers ===== */

body:has(.v68-page) {
    font-weight: 400;
}

body:has(.v68-page) strong,
body:has(.v68-page) b,
body:has(.v68-page) h1,
body:has(.v68-page) h2,
body:has(.v68-page) h3 {
    font-weight: 500;
}

body:has(.v68-page) .page,
body:has(.v68-page) .container,
body:has(.v68-page) main {
    max-width: min(1320px, calc(100% - 44px)) !important;
    width: min(1320px, calc(100% - 44px)) !important;
}

.v68-page {
    --v68-border: #dce7eb;
    --v68-soft: #f7fafb;
    --v68-text: #253842;
    --v68-muted: #7c8b92;
    --v68-ok-bg: #f8fcfa;
    --v68-ok-border: #d5eadf;
    --v68-warn-bg: #fffaf2;
    --v68-warn-border: #ead8b1;
    --v68-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v68-board {
    background: #fff;
    border: 1px solid var(--v68-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v68-shadow);
}

.v68-hero,
.v68-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v68-hero {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--v68-border);
}

.v68-hero span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.v68-hero h2,
.v68-card-head h3 {
    margin: 0;
    color: var(--v68-text);
    line-height: 1.45;
}

.v68-hero h2 {
    font-size: 21px;
}

.v68-card-head h3 {
    font-size: 15.6px;
}

.v68-hero p,
.v68-card-head p {
    margin: 4px 0 0;
    color: var(--v68-muted);
    font-size: 12.2px;
    line-height: 1.65;
}

.v68-actions,
.v68-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v68-actions a,
.v68-form-actions a,
.v68-link,
.v68-form-actions button {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v68-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 10px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.v68-actions .is-primary,
.v68-link.is-primary,
.v68-form-actions button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v68-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v68-border);
}

.v68-kpis div {
    min-height: 46px;
    border: 1px solid var(--v68-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
    gap: 1px;
}

.v68-kpis span {
    color: var(--v68-muted);
    font-size: 11.3px;
}

.v68-kpis strong {
    color: var(--primary-dark);
    font-size: 15px;
    line-height: 1.3;
}

.v68-table-card,
.v68-form-card {
    margin-top: 9px;
    border: 1px solid var(--v68-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

.v68-table-wrap {
    width: 100%;
    overflow-x: hidden;
}

.v68-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v68-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v68-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v68-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v68-border);
    color: var(--v68-text);
    font-size: 12.2px;
    line-height: 1.45;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v68-table .col-name {
    width: 32%;
}

.v68-table .col-action {
    width: 110px;
    text-align: center;
}

.v68-table .name-cell strong {
    display: block;
    color: var(--v68-text);
    font-size: 12.8px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.v68-table .name-cell span {
    display: block;
    margin-top: 1px;
    color: var(--v68-muted);
    font-size: 11.2px;
    white-space: normal;
}

.v68-table .empty {
    text-align: center;
    color: var(--v68-muted);
    padding: 18px 8px;
}

.v68-badge {
    min-height: 22px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.6px;
    font-weight: 500;
    white-space: nowrap;
}

.v68-badge.ok {
    background: #edf8f2;
    color: var(--success);
}

.v68-badge.warn {
    background: #fff6e7;
    color: #8a5a00;
}

.v68-badge.strong {
    background: #edf5f7;
    color: var(--primary-dark);
}

/* Forms */
.v68-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.v68-form-grid .full {
    grid-column: 1 / -1;
}

.v68-form-grid label {
    display: block;
    color: var(--v68-text);
    font-size: 12.2px;
    margin-bottom: 4px;
}

.v68-form-grid input[type="text"],
.v68-form-grid input[type="date"],
.v68-form-grid input[type="number"],
.v68-form-grid select,
.v68-form-grid textarea {
    width: 100%;
    border: 1px solid var(--v68-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v68-text);
    padding: 7px 9px;
    font-family: inherit;
    font-size: 12.6px;
    outline: none;
}

.v68-form-grid textarea {
    resize: vertical;
}

.v68-check-row {
    display: flex;
    align-items: end;
}

.v68-check-row label {
    min-height: 36px;
    width: 100%;
    border: 1px solid var(--v68-border);
    border-radius: 10px;
    background: #fbfdfe;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.v68-form-actions {
    margin-top: 10px;
}

/* Stage detail V68 links if mini actions increased */
.v65-stage-page .v63-mini-actions {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .v68-hero,
    .v68-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v68-table-wrap {
        overflow-x: auto;
    }

    .v68-table {
        min-width: 860px;
    }

    .v65-stage-page .v63-mini-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body:has(.v68-page) .page,
    body:has(.v68-page) .container,
    body:has(.v68-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v68-kpis,
    .v68-form-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== V69 Opportunity committee + candidate score documentation ===== */

body:has(.v69-page) {
    font-weight: 400;
}

body:has(.v69-page) strong,
body:has(.v69-page) b,
body:has(.v69-page) h1,
body:has(.v69-page) h2,
body:has(.v69-page) h3 {
    font-weight: 500;
}

body:has(.v69-page) .page,
body:has(.v69-page) .container,
body:has(.v69-page) main {
    max-width: min(1320px, calc(100% - 44px)) !important;
    width: min(1320px, calc(100% - 44px)) !important;
}

.v69-page {
    --v69-border: #dce7eb;
    --v69-text: #253842;
    --v69-muted: #7c8b92;
    --v69-shadow: 0 6px 16px rgba(22, 50, 65, 0.032);
}

.v69-board {
    background: #fff;
    border: 1px solid var(--v69-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--v69-shadow);
}

.v69-hero,
.v69-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v69-hero {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--v69-border);
}

.v69-hero span {
    display: block;
    color: var(--primary);
    font-size: 10.8px;
    margin-bottom: 2px;
}

.v69-hero h2,
.v69-card-head h3 {
    margin: 0;
    color: var(--v69-text);
    line-height: 1.45;
}

.v69-hero h2 {
    font-size: 21px;
}

.v69-card-head h3 {
    font-size: 15.6px;
}

.v69-hero p,
.v69-card-head p {
    margin: 4px 0 0;
    color: var(--v69-muted);
    font-size: 12.2px;
    line-height: 1.65;
}

.v69-actions,
.v69-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.v69-actions a,
.v69-form-actions a,
.v69-form-actions button,
.v69-doc-link,
.v69-card-head button {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--v69-border);
    border-radius: 9px;
    background: #f3f7f8;
    color: var(--primary-dark);
    padding: 5px 10px;
    font-family: inherit;
    font-size: 11.8px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.v69-actions .is-primary,
.v69-form-actions button,
.v69-card-head button {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.v69-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 0;
    border-bottom: 1px solid var(--v69-border);
}

.v69-kpis div {
    min-height: 46px;
    border: 1px solid var(--v69-border);
    border-radius: 12px;
    background: #fff;
    padding: 7px 9px;
    display: grid;
    align-content: center;
}

.v69-kpis span {
    color: var(--v69-muted);
    font-size: 11.3px;
}

.v69-kpis strong {
    color: var(--primary-dark);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.v69-table-card,
.v69-form-card {
    margin-top: 9px;
    border: 1px solid var(--v69-border);
    border-radius: 14px;
    background: #fff;
    padding: 10px;
}

.v69-table-wrap {
    width: 100%;
    overflow-x: hidden;
}

.v69-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.v69-table th {
    background: #f3f7f8;
    color: #455d66;
    border-bottom: 1px solid var(--v69-border);
    padding: 7px 8px;
    text-align: right;
    font-size: 11.4px;
    font-weight: 500;
    white-space: nowrap;
}

.v69-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--v69-border);
    color: var(--v69-text);
    font-size: 12.2px;
    line-height: 1.45;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v69-table .col-name {
    width: 33%;
}

.v69-table .col-committee {
    width: 260px;
}

.v69-table .name-cell strong {
    display: block;
    color: var(--v69-text);
    white-space: normal;
    overflow-wrap: anywhere;
}

.v69-table select,
.v69-form-grid select,
.v69-form-grid input,
.v69-form-grid textarea {
    width: 100%;
    border: 1px solid var(--v69-border);
    border-radius: 10px;
    background: #fff;
    color: var(--v69-text);
    padding: 7px 9px;
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
}

.v69-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.v69-form-grid .full {
    grid-column: 1 / -1;
}

.v69-form-grid label {
    display: block;
    color: var(--v69-text);
    font-size: 12.2px;
    margin-bottom: 4px;
}

.v69-form-grid textarea {
    resize: vertical;
}

.v69-form-actions {
    margin-top: 10px;
}

.v69-hint {
    border: 1px dashed var(--v69-border);
    border-radius: 12px;
    background: #fbfdfe;
    padding: 8px 10px;
    margin-bottom: 9px;
    color: var(--v69-muted);
    font-size: 12.3px;
}

.v69-hint strong {
    color: var(--v69-text);
}

.v69-badge {
    min-height: 22px;
    border-radius: 999px;
    background: #edf5f7;
    color: var(--primary-dark);
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.6px;
    font-weight: 500;
    white-space: nowrap;
}

.v69-badge.strong {
    font-variant-numeric: tabular-nums;
}

.v69-table .empty {
    text-align: center;
    color: var(--v69-muted);
    padding: 18px 8px;
}

.v69-doc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.v69-doc-link {
    min-height: 28px;
    padding: 4px 9px;
}

.v65-stage-page .v63-mini-actions {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .v69-hero,
    .v69-card-head,
    .v69-doc-head {
        flex-direction: column;
        align-items: stretch;
    }

    .v69-table-wrap {
        overflow-x: auto;
    }

    .v69-table {
        min-width: 900px;
    }

    .v65-stage-page .v63-mini-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body:has(.v69-page) .page,
    body:has(.v69-page) .container,
    body:has(.v69-page) main {
        max-width: calc(100% - 22px) !important;
        width: calc(100% - 22px) !important;
    }

    .v69-kpis,
    .v69-form-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== V69.2: show documentation action clearly ===== */

.v69-top-doc-action a {
    margin-top: 4px;
    min-height: 24px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.v67-doc-block small {
    line-height: 1.65;
}

/* ============================================================
   V74 Import Center: compact stepwise Excel import page
   ============================================================ */
body:has(.v74-import-center) .page,
    body:has(.v74-import-center) .container,
    body:has(.v74-import-center) main {
        max-width: min(1540px, calc(100% - 44px)) !important;
        width: min(1540px, calc(100% - 44px)) !important;
    }

    .v74-import-center {
        --v74-border: #dce7eb;
        --v74-soft: #f7fafb;
        --v74-text: #253842;
        --v74-muted: #7c8b92;
        --v74-primary: #286f81;
        --v74-primary-dark: #1f5d6c;
        --v74-success: #287a58;
        --v74-warning: #9a6414;
        --v74-danger: #9b2c2c;
        --v74-shadow: 0 6px 16px rgba(22, 50, 65, .035);
        color: var(--v74-text);
    }

    .v74-import-center h1,
    .v74-import-center h2,
    .v74-import-center h3,
    .v74-import-center h4,
    .v74-import-center strong,
    .v74-import-center b {
        font-weight: 500;
    }

    .v74-hero,
    .v74-flow,
    .v74-stage-panel,
    .v74-card,
    .v74-report,
    .v74-confirm-card {
        background: #fff;
        border: 1px solid var(--v74-border);
        border-radius: 18px;
        box-shadow: var(--v74-shadow);
    }

    .v74-hero {
        padding: 18px 20px;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .v74-hero span,
    .v74-card-head span,
    .v74-report-head span,
    .v74-confirm-card span,
    .v74-stage-label,
    .v74-section-label {
        display: block;
        color: var(--v74-primary);
        font-size: 12px;
        font-weight: 600;
    }

    .v74-hero h2 {
        margin: 3px 0 4px;
        font-size: 23px;
        line-height: 1.4;
    }

    .v74-hero p,
    .v74-card-head p,
    .v74-report-head p,
    .v74-confirm-card p,
    .v74-stage-text,
    .v74-flow span,
    .v74-help,
    .v74-note {
        margin: 0;
        color: var(--v74-muted);
        font-size: 12.5px;
        line-height: 1.75;
    }

    .v74-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
    }

    .v74-actions a,
    .v74-stage-form button,
    .v74-submit,
    .v74-confirm-submit {
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--v74-border);
        border-radius: 11px;
        background: #eef4f6;
        color: var(--v74-primary-dark);
        padding: 6px 12px;
        font-family: inherit;
        font-size: 12.5px;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        text-decoration: none;
    }

    .v74-actions a.is-primary,
    .v74-submit,
    .v74-confirm-submit {
        background: var(--v74-primary);
        border-color: var(--v74-primary);
        color: #fff;
    }

    .v74-flow {
        min-height: 42px;
        padding: 8px 12px;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 9px;
        flex-wrap: wrap;
    }

    .v74-flow b {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: var(--v74-primary-dark);
        font-size: 12.5px;
    }

    .v74-flow b::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: var(--v74-primary);
    }

    .v74-flow i {
        width: 28px;
        height: 1px;
        background: var(--v74-border);
        display: inline-block;
    }

    .v74-stage-panel {
        padding: 12px;
        margin-bottom: 10px;
    }

    .v74-stage-row {
        display: grid;
        grid-template-columns: minmax(420px, 1fr) minmax(420px, .9fr);
        gap: 12px;
        align-items: center;
    }

    .v74-stage-title h3 {
        margin: 3px 0 4px;
        font-size: 18px;
        line-height: 1.45;
    }

    .v74-stage-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 7px;
    }

    .v74-chip {
        min-height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--v74-border);
        border-radius: 999px;
        background: var(--v74-soft);
        color: var(--v74-primary-dark);
        padding: 2px 9px;
        font-size: 11.7px;
        line-height: 1.45;
    }

    .v74-stage-form {
        display: grid;
        grid-template-columns: minmax(240px, 1fr) auto;
        gap: 7px;
        align-items: center;
    }

    .v74-stage-form select,
    .v74-field input[type="file"] {
        width: 100%;
        min-height: 38px;
        border: 1px solid var(--v74-border);
        border-radius: 12px;
        background: #fff;
        padding: 7px 10px;
        font-family: inherit;
        font-size: 13px;
    }

    .v74-stage-form button {
        min-height: 38px;
        background: var(--v74-primary);
        border-color: var(--v74-primary);
        color: #fff;
    }

    .v74-main-grid {
        display: grid;
        grid-template-columns: minmax(520px, 1.22fr) minmax(360px, .78fr);
        gap: 12px;
        align-items: start;
        margin-bottom: 12px;
    }

    .v74-card {
        padding: 14px;
    }

    .v74-card-head,
    .v74-report-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
    }

    .v74-card-head h3,
    .v74-report-head h3,
    .v74-confirm-card h3 {
        margin: 0 0 3px;
        font-size: 17px;
        line-height: 1.45;
    }

    .v74-form-grid {
        display: grid;
        gap: 10px;
    }

    .v74-field label,
    .v74-options-title {
        display: block;
        margin-bottom: 5px;
        color: var(--v74-text);
        font-size: 12.6px;
        font-weight: 500;
    }

    .v74-help,
    .v74-error {
        display: block;
        margin-top: 4px;
        font-size: 11.8px;
        line-height: 1.6;
    }

    .v74-error {
        color: var(--v74-danger);
    }

    .v74-mode-list #id_import_mode,
    .v74-checks {
        display: grid;
        gap: 6px;
    }

    .v74-mode-list #id_import_mode {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v74-mode-list #id_import_mode > div,
    .v74-checks label {
        min-height: 36px;
        display: flex;
        align-items: center;
        gap: 8px;
        border: 1px solid var(--v74-border);
        border-radius: 12px;
        background: var(--v74-soft);
        padding: 6px 10px;
        font-size: 12.5px;
        cursor: pointer;
    }

    .v74-mode-list label {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }

    .v74-checks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v74-submit,
    .v74-confirm-submit {
        width: 100%;
        margin-top: 2px;
    }

    .v74-columns {
        display: grid;
        gap: 8px;
    }

    .v74-column-group {
        border: 1px solid var(--v74-border);
        border-radius: 14px;
        background: #fbfdfe;
        padding: 9px;
    }

    .v74-column-group h4 {
        margin: 0 0 7px;
        font-size: 12.8px;
        color: var(--v74-primary-dark);
    }

    .v74-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .v74-chips span {
        min-height: 23px;
        display: inline-flex;
        align-items: center;
        border: 1px solid var(--v74-border);
        border-radius: 999px;
        background: #fff;
        color: #405762;
        padding: 2px 8px;
        font-size: 11.5px;
    }

    .v74-note-box {
        margin-top: 10px;
        border: 1px dashed #bfd2da;
        border-radius: 14px;
        background: #f7fafb;
        padding: 9px 10px;
    }

    .v74-note-box strong {
        display: block;
        color: var(--v74-text);
        margin-bottom: 2px;
        font-size: 12.5px;
    }

    .v74-warning-box {
        border: 1px solid #f1d9ad;
        background: #fff8ed;
        color: #8a5a00;
        border-radius: 14px;
        padding: 10px 12px;
        margin-bottom: 12px;
        font-size: 12.8px;
        line-height: 1.8;
    }

    .v74-confirm-card {
        padding: 13px;
        margin-bottom: 12px;
        border-color: #cfe8dc;
        background: #f8fdf9;
    }

    .v74-confirm-grid {
        display: grid;
        grid-template-columns: 1fr minmax(240px, auto);
        gap: 12px;
        align-items: center;
    }

    .v74-confirm-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 7px;
    }

    .v74-kpis {
        display: grid;
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 8px;
        margin: 0 0 12px;
    }

    .v74-kpi {
        border: 1px solid var(--v74-border);
        border-radius: 14px;
        background: #fff;
        box-shadow: var(--v74-shadow);
        padding: 9px;
    }

    .v74-kpi span {
        display: block;
        color: var(--v74-muted);
        font-size: 11.5px;
        margin-bottom: 3px;
    }

    .v74-kpi strong {
        color: var(--v74-primary-dark);
        font-size: 19px;
        line-height: 1.2;
    }

    .v74-report {
        padding: 13px;
        margin-bottom: 12px;
    }

    .v74-table-wrap {
        overflow-x: auto;
    }

    .v74-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

    .v74-table th {
        background: #f2f6f7;
        color: #405762;
        font-weight: 600;
        font-size: 12px;
        text-align: right;
        padding: 8px;
        border-bottom: 1px solid var(--v74-border);
        white-space: nowrap;
    }

    .v74-table td {
        padding: 8px;
        border-bottom: 1px solid var(--v74-border);
        color: #2e3d45;
        font-size: 12.5px;
        line-height: 1.55;
        vertical-align: middle;
        white-space: normal;
    }

    .v74-status {
        min-height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        padding: 2px 9px;
        font-size: 11.5px;
        font-weight: 600;
    }

    .v74-status.ok {
        background: #eaf7f0;
        color: var(--v74-success);
    }

    .v74-status.warn {
        background: #fff4df;
        color: var(--v74-warning);
    }

    .v74-status.error {
        background: #fff4f4;
        color: var(--v74-danger);
    }

    @media (max-width: 1180px) {
        .v74-stage-row,
        .v74-main-grid,
        .v74-confirm-grid,
        .v74-kpis {
            grid-template-columns: 1fr;
        }

        .v74-mode-list #id_import_mode,
        .v74-checks,
        .v74-kpis {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (max-width: 760px) {
        body:has(.v74-import-center) .page,
        body:has(.v74-import-center) .container,
        body:has(.v74-import-center) main {
            width: calc(100% - 24px) !important;
        }

        .v74-hero,
        .v74-card-head,
        .v74-report-head {
            flex-direction: column;
            align-items: stretch;
        }

        .v74-flow,
        .v74-stage-form,
        .v74-mode-list #id_import_mode,
        .v74-checks,
        .v74-kpis {
            grid-template-columns: 1fr;
        }

        .v74-flow i {
            display: none;
        }
    }

/* ===== V75 Final Preview Light Typography Overrides =====
   تنسيقات مركز اعتماد الترشيح النهائي.
   الهدف: تخفيف السماكات ونقل تنسيقات الصفحة من القالب إلى ملف app.css العام.
*/
.v57-final-preview-page,
    .v60-final-summary-page {
        font-weight: 400;
    }

    .v57-final-preview-page strong,
    .v57-final-preview-page b,
    .v60-final-summary-page strong,
    .v60-final-summary-page b {
        font-weight: 500;
    }

    .v57-hero h2,
    .v57-card-head h3,
    .v57-rule strong,
    .v59-filter-card strong,
    .v59-opportunity-summary strong {
        font-weight: 500 !important;
        letter-spacing: 0;
    }

    .v57-hero p,
    .v57-card-head p,
    .v57-rule p,
    .v59-filter-card p {
        font-weight: 400 !important;
    }

    .v57-kpis strong,
    .v57-table strong,
    .v60-count-badge,
    .v57-badge,
    .v57-chip {
        font-weight: 500 !important;
    }

    .v57-table th {
        font-weight: 500 !important;
    }

    .v57-table td,
    .v57-table td span,
    .v57-table td a,
    .note-cell {
        font-weight: 400 !important;
    }

    .name-cell strong {
        font-weight: 500 !important;
    }

    .v57-action-link,
    .v57-hero-actions a,
    .v59-filter-form button,
    .v59-filter-form a {
        font-weight: 500 !important;
    }

    .v75-metrics-strip {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }

    .v75-metrics-strip div {
        min-height: 46px;
        border: 0;
        border-radius: 12px;
        background: #f8fbfc;
        padding: 8px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        box-shadow: inset 0 0 0 1px rgba(220, 231, 235, 0.65);
    }

    .v75-metrics-strip span {
        color: var(--muted);
        font-size: 12px;
        font-weight: 400;
    }

    .v75-metrics-strip strong {
        color: var(--primary-dark);
        font-size: 18px;
        font-weight: 500 !important;
        line-height: 1;
    }

    .v75-metrics-strip div.ok {
        background: #f6fbf8;
        box-shadow: inset 0 0 0 1px rgba(207, 232, 220, 0.75);
    }

    .v75-metrics-strip div.warn {
        background: #fffaf0;
        box-shadow: inset 0 0 0 1px rgba(241, 223, 185, 0.85);
    }

    .v75-table-toolbar {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 12px;
    }

    .v75-table-toolbar__title h3 {
        margin: 0 0 4px;
        font-size: 18px;
        font-weight: 500;
        color: var(--text);
    }

    .v75-table-toolbar__title p {
        margin: 0;
        color: var(--muted);
        font-size: 12.5px;
        line-height: 1.7;
        font-weight: 400;
    }

    .v75-filter-form {
        display: grid;
        grid-template-columns: minmax(260px, 360px) auto auto;
        gap: 7px;
        align-items: center;
    }

    .v75-filter-form select {
        min-height: 36px;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: #fff;
        color: var(--text);
        padding: 7px 10px;
        font-family: inherit;
        font-size: 12.5px;
        font-weight: 400;
    }

    .v75-filter-form button,
    .v75-filter-form a {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--line);
        border-radius: 11px;
        padding: 7px 12px;
        background: #eef4f6;
        color: var(--primary-dark);
        font-family: inherit;
        font-size: 12.5px;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
    }

    .v75-filter-form button {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }

    .v75-note {
        margin: 0 0 12px;
        border: 1px dashed #bfd2da;
        border-radius: 13px;
        background: #f7fafb;
        color: var(--muted);
        padding: 10px 12px;
        font-size: 12.5px;
        line-height: 1.8;
        font-weight: 400;
    }

    .v75-selected-summary {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }

    .v75-selected-summary div {
        min-height: 46px;
        border: 0;
        border-radius: 12px;
        background: #f8fbfc;
        padding: 8px 12px;
        box-shadow: inset 0 0 0 1px rgba(220, 231, 235, 0.65);
    }

    .v75-selected-summary span {
        display: block;
        color: var(--muted);
        font-size: 11.5px;
        margin-bottom: 3px;
        font-weight: 400;
    }

    .v75-selected-summary strong {
        display: block;
        color: var(--primary-dark);
        font-size: 13px;
        font-weight: 500 !important;
        line-height: 1.4;
    }

    @media (max-width: 1100px) {
        .v75-metrics-strip,
        .v75-selected-summary {
            grid-template-columns: repeat(2, 1fr);
        }

        .v75-table-toolbar {
            align-items: stretch;
            flex-direction: column;
        }

        .v75-filter-form {
            grid-template-columns: 1fr auto auto;
        }
    }

    @media (max-width: 700px) {
        .v75-metrics-strip,
        .v75-selected-summary,
        .v75-filter-form {
            grid-template-columns: 1fr;
        }
    }

