:root {
    --ui-primary: #0f766e;
    --ui-primary-dark: #115e59;
    --ui-primary-soft: #ccfbf1;
    --ui-accent: #2563eb;
    --ui-danger: #dc2626;
    --ui-bg: #f4f7fb;
    --ui-surface: #ffffff;
    --ui-surface-muted: #f8fafc;
    --ui-border: #dbe3ee;
    --ui-border-strong: #c5d0de;
    --ui-text: #172033;
    --ui-text-muted: #64748b;
    --ui-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --ui-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    --ui-radius-sm: 8px;
    --ui-radius: 14px;
    --ui-radius-lg: 20px;
}

html {
    min-height: 100%;
}

body.modern-app {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ui-text);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 32rem),
        var(--ui-bg);
    font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.modern-app *,
.modern-dialog * {
    box-sizing: border-box;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 12px clamp(18px, 4vw, 56px);
    color: #ffffff;
    background: linear-gradient(120deg, #0f172a 0%, #123b55 58%, #0f766e 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
}

.app-header img {
    display: block;
    max-width: 145px;
    max-height: 36px;
    padding: 0 !important;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.app-header__title {
    padding: 0 !important;
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 650 !important;
    letter-spacing: 0.01em;
}

.app-page {
    width: min(1180px, calc(100% - 40px)) !important;
    min-height: calc(100vh - 108px);
    height: auto !important;
    margin: 28px auto 40px !important;
    padding: 0 !important;
    background: transparent !important;
}

.app-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 !important;
    float: none !important;
}

.app-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
}

.app-form-card {
    width: min(620px, 100%) !important;
    margin: 0 auto !important;
    padding: clamp(24px, 4vw, 42px) !important;
}

.app-form-card::before {
    display: block;
    margin-bottom: 4px;
    color: var(--ui-text);
    font-size: 24px;
    font-weight: 700;
    content: "Connection settings";
}

.app-form-card::after {
    display: block;
    margin-bottom: 26px;
    color: var(--ui-text-muted);
    content: "Configure and verify the Primavera connection used by the integration.";
}

.app-form-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 14px;
}

.app-form-table td:first-child {
    width: 42%;
    padding-right: 22px;
    color: #334155;
    font-weight: 600;
}

.app-form-table td {
    vertical-align: middle;
}

.modern-app input[type="text"],
.modern-app input[type="password"],
.modern-app input[type="number"],
.modern-app select,
.modern-app textarea,
.modern-dialog input[type="text"],
.modern-dialog input[type="password"],
.modern-dialog input[type="number"],
.modern-dialog select,
.modern-dialog textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    color: var(--ui-text);
    background: #ffffff;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    outline: none;
    font: inherit;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.modern-app input[type="text"]:focus,
.modern-app input[type="password"]:focus,
.modern-app input[type="number"]:focus,
.modern-app select:focus,
.modern-app textarea:focus,
.modern-dialog input[type="text"]:focus,
.modern-dialog input[type="password"]:focus,
.modern-dialog input[type="number"]:focus,
.modern-dialog select:focus,
.modern-dialog textarea:focus {
    border-color: var(--ui-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.modern-app input[type="checkbox"],
.modern-app input[type="radio"],
.modern-dialog input[type="checkbox"],
.modern-dialog input[type="radio"] {
    width: 17px;
    height: 17px;
    margin: 0 6px 0 0;
    accent-color: var(--ui-primary);
    vertical-align: middle;
}

.modern-app input[type="button"],
.modern-app input[type="submit"],
.modern-dialog input[type="button"],
.modern-dialog input[type="submit"] {
    min-height: 40px;
    padding: 9px 16px;
    color: #ffffff;
    background: var(--ui-primary);
    border: 1px solid var(--ui-primary);
    border-radius: var(--ui-radius-sm);
    box-shadow: var(--ui-shadow-sm);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.modern-app input[type="button"]:hover,
.modern-app input[type="submit"]:hover,
.modern-dialog input[type="button"]:hover,
.modern-dialog input[type="submit"]:hover {
    background: var(--ui-primary-dark);
    border-color: var(--ui-primary-dark);
    box-shadow: 0 7px 18px rgba(15, 118, 110, 0.2);
    transform: translateY(-1px);
}

.modern-app input[type="button"]:focus-visible,
.modern-app input[type="submit"]:focus-visible,
.modern-dialog input[type="button"]:focus-visible,
.modern-dialog input[type="submit"]:focus-visible,
.modern-app a:focus-visible,
.modern-dialog a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

.modern-app input[type="button"]:disabled,
.modern-app input[type="submit"]:disabled,
.modern-dialog input[type="button"]:disabled,
.modern-dialog input[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.button-secondary {
    color: #334155 !important;
    background: #ffffff !important;
    border-color: var(--ui-border-strong) !important;
}

.button-secondary:hover {
    background: var(--ui-surface-muted) !important;
    border-color: #94a3b8 !important;
    box-shadow: var(--ui-shadow-sm) !important;
}

.button-wide {
    width: 100% !important;
}

.dashboard-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 22px;
    width: min(1220px, calc(100% - 40px)) !important;
    min-height: calc(100vh - 132px);
    height: auto !important;
    margin: 28px auto 36px !important;
    padding: 0 !important;
    background: transparent !important;
}

.dashboard-main,
.transfer-main {
    min-width: 0;
    padding: 18px !important;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
}

.dashboard-main {
    height: calc(100vh - 150px) !important;
}

.dashboard-main #jqxProjectGrid {
    height: calc(100% - 60px) !important;
}

.dashboard-actions {
    display: flex !important;
    flex-direction: column;
    align-self: start;
    gap: 12px;
    margin: 0 !important;
    padding: 18px !important;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
}

.dashboard-actions::before {
    display: block;
    margin-bottom: 4px;
    color: var(--ui-text);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    content: "Actions";
}

.dashboard-actions > div,
.dashboard-actions input[type="button"] {
    width: 100% !important;
    margin: 0 !important;
    height: auto;
    min-height: 50px;
    white-space: normal;
    line-height: 1.25;
}

.dashboard-link-row {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin-top: 12px !important;
    padding: 0 4px;
}

.circular-reference-panel {
    display: flex;
    flex-direction: column;
    width: min(1720px, calc(100vw - 24px));
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
    margin: 0 auto;
    padding: 20px;
    overflow: hidden;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
}

#divLevelCodeDiog.circular-reference-modal {
    padding: 12px !important;
    overflow: hidden !important;
}

.circular-reference-panel__header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.circular-reference-panel__header h2 {
    margin: 0;
    color: var(--ui-text);
    font-size: 18px;
    font-weight: 700;
}

#circularReferenceMessage {
    margin-top: 3px;
    color: var(--ui-text-muted);
    font-weight: 650;
}

.circular-reference-close {
    width: auto !important;
    min-width: 88px;
    flex: 0 0 auto;
}

.circular-reference-tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--ui-border);
}

.circular-reference-tab {
    min-height: 38px;
    padding: 8px 16px;
    color: var(--ui-text-muted);
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.circular-reference-tab:hover {
    color: var(--ui-text);
    background: #f8fafc;
}

.circular-reference-tab.is-active {
    color: var(--ui-primary);
    border-bottom-color: var(--ui-primary);
}

.circular-reference-tab-panel {
    display: none;
}

.circular-reference-tab-panel.is-active {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.circular-grid-cell {
    min-height: 28px;
    padding: 5px 7px;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.35;
}

.circular-reference-table-wrap {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
}

.circular-reference-table {
    width: auto;
    min-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #ffffff;
}

.circular-reference-table th,
.circular-reference-table td {
    padding: 9px 10px;
    border-right: 1px solid #e7edf4;
    border-bottom: 1px solid #e7edf4;
    color: var(--ui-text);
    text-align: left;
    vertical-align: top;
}

.circular-reference-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    overflow: visible;
    padding-right: 18px;
    background: #eef3f8;
    color: #334155;
    font-weight: 650;
    user-select: none;
}

.circular-reference-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.circular-reference-table tbody tr:hover {
    background: var(--ui-primary-soft);
}

.circular-reference-table th:first-child,
.circular-reference-table td:first-child {
    width: 90px;
    text-align: center;
}

.circular-reference-wrap {
    min-width: 180px;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.circular-reference-explanation {
    min-width: 300px;
}

.circular-column-resizer {
    position: absolute;
    top: 0;
    right: -3px;
    z-index: 3;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}

.circular-column-resizer::after {
    position: absolute;
    top: 9px;
    right: 3px;
    width: 1px;
    height: calc(100% - 18px);
    background: #cbd5e1;
    content: "";
}

.circular-graph-list {
    display: grid;
    gap: 14px;
    width: 100%;
    min-height: 0;
    overflow: auto;
    padding: 2px 2px 8px;
}

.circular-graph-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.circular-graph-toolbar {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 12px;
}

.circular-graph-toolbar input[type="button"] {
    width: auto !important;
    min-height: 34px;
    padding: 7px 12px;
}

.circular-graph-card {
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    box-shadow: var(--ui-shadow-sm);
}

.circular-graph-card__title {
    margin-bottom: 12px;
    color: var(--ui-text);
    font-size: 15px;
    font-weight: 750;
}

.circular-graph-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    background: #f8fafc;
    border: 1px solid #e7edf4;
    border-radius: 8px;
    color: var(--ui-text);
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.8;
}

.circular-graph-node {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 3px 9px;
    background: #ffffff;
    border: 1px solid var(--ui-border-strong);
    border-radius: 7px;
    font-weight: 700;
    white-space: nowrap;
}

.circular-graph-node.is-cycle-close {
    color: #7f1d1d;
    background: #fee2e2;
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.circular-graph-edge {
    color: var(--ui-primary-dark);
    font-weight: 800;
    white-space: nowrap;
}

.modern-app a {
    color: var(--ui-accent);
    font-weight: 650;
    text-decoration: none;
}

.modern-app a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.transfer-layout {
    width: min(1180px, calc(100% - 40px)) !important;
    height: auto !important;
    margin: 28px auto 36px !important;
    padding: 0 !important;
    background: transparent !important;
}

.transfer-main {
    padding: 18px 18px 24px !important;
}

.transfer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 16px;
}

.transfer-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    color: #334155;
    font-weight: 600;
}

.modern-app .jqx-widget,
.modern-app .jqx-widget-content,
.modern-dialog .jqx-widget,
.modern-dialog .jqx-widget-content {
    font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif !important;
}

.modern-app .jqx-widget,
.modern-dialog .jqx-widget {
    border-color: var(--ui-border) !important;
    border-radius: 10px;
}

.modern-app .jqx-grid-header,
.modern-app .jqx-widget-header,
.modern-dialog .jqx-grid-header,
.modern-dialog .jqx-widget-header {
    color: #334155 !important;
    background: #eef3f8 !important;
    border-color: var(--ui-border) !important;
    font-weight: 650;
}

.modern-app .jqx-grid-cell,
.modern-app .jqx-grid-cell-filter-row,
.modern-dialog .jqx-grid-cell,
.modern-dialog .jqx-grid-cell-filter-row {
    color: var(--ui-text) !important;
    background: #ffffff;
    border-color: #e7edf4 !important;
}

.modern-app .jqx-grid-cell-alt,
.modern-dialog .jqx-grid-cell-alt {
    background: #f8fafc !important;
}

.modern-app .jqx-grid-cell-selected,
.modern-app .jqx-grid-cell-hover,
.modern-dialog .jqx-grid-cell-selected,
.modern-dialog .jqx-grid-cell-hover {
    color: #0f3f3b !important;
    background: var(--ui-primary-soft) !important;
}

.modern-app .jqx-input,
.modern-dialog .jqx-input {
    border-color: var(--ui-border-strong) !important;
    border-radius: 6px !important;
}

.modal {
    padding: 28px 20px !important;
    background: rgba(15, 23, 42, 0.62) !important;
    backdrop-filter: blur(4px);
}

.loading-overlay {
    display: none;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 20px !important;
    background: rgba(15, 23, 42, 0.62) !important;
    opacity: 1 !important;
    backdrop-filter: blur(3px);
}

.loading-overlay p {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 16px 20px;
    color: var(--ui-text) !important;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--ui-shadow);
    font-weight: 650;
    transform: translate(-50%, -50%);
}

.loading-overlay img {
    width: 24px;
    height: 24px;
}

.modern-dialog {
    color: var(--ui-text);
    font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
    font-size: 14px;
}

.modern-dialog-card,
#mainDiv.modern-dialog-card,
#Grid.modern-dialog-card,
.custom-container.modern-dialog-card,
.main-ui.modern-dialog-card,
.genealogy-dialog {
    background: var(--ui-surface) !important;
    border: 1px solid rgba(148, 163, 184, 0.38) !important;
    border-radius: var(--ui-radius-lg) !important;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28) !important;
}

#mainDiv.modern-dialog-card {
    display: flex;
    flex-direction: column;
    width: min(840px, 94vw) !important;
    height: auto !important;
    max-height: min(760px, calc(100dvh - 32px)) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: hidden;
    border-style: solid !important;
}

#mainDiv.modern-dialog-card.criteria-dialog-update {
    height: min(630px, calc(100dvh - 52px)) !important;
}

#mainDiv.modern-dialog-card > .criteria-dialog-content {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

#mainDiv.modern-dialog-card > .criteria-dialog-content > .fieldsSec,
#mainDiv.modern-dialog-card > .criteria-dialog-content > .mappingSec {
    padding: 18px !important;
}

#mainDiv.modern-dialog-card > .criteria-dialog-content > .fieldsSec {
    flex: 1 1 58% !important;
    width: auto !important;
    min-width: 0;
    border-right: 1px solid var(--ui-border) !important;
}

#mainDiv.modern-dialog-card > .criteria-dialog-content > .mappingSec {
    flex: 1 1 42% !important;
}

#mainDiv.modern-dialog-card h3 {
    margin: 0 0 12px;
    color: var(--ui-text);
    font-size: 17px;
    font-weight: 700;
}

#mainDiv.modern-dialog-card table {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 2px;
    font-size: 12.5px !important;
    line-height: 1.25;
}

#mainDiv.modern-dialog-card .fieldsSec > table {
    table-layout: fixed;
}

#mainDiv.modern-dialog-card td {
    padding: 4px 7px;
    background: transparent;
    vertical-align: middle;
}

#mainDiv.modern-dialog-card .fieldsSec td:first-child {
    width: 50%;
    min-width: 0;
}

#mainDiv.modern-dialog-card .baselineHide td:first-child,
#mainDiv.modern-dialog-card .baselineShow td:first-child {
    padding-left: 20px !important;
}

#mainDiv.modern-dialog-card tr:nth-child(even) {
    background: #f8fafc;
}

#mainDiv.modern-dialog-card tr {
    border-radius: 7px;
}

#mainDiv.modern-dialog-card .smallbutton {
    left: 0;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    color: #334155;
    background: #f8fafc;
    border-color: var(--ui-border-strong);
}

#mainDiv.modern-dialog-card .cleardata {
    top: 6px;
    margin-left: 5px;
}

#mainDiv.modern-dialog-card .deleted-tasks-text {
    width: 100%;
    min-width: 170px;
    min-height: 64px;
    max-height: 120px;
}

#mainDiv.modern-dialog-card .deleted-tasks-row > td:last-child {
    width: 100%;
}

#mainDiv.modern-dialog-card .deleted-tasks-row-content {
    display: grid;
    grid-template-columns: minmax(165px, 1fr) minmax(190px, 1fr);
    align-items: start;
    gap: 8px;
    width: 100%;
}

#mainDiv.modern-dialog-card .deleted-tasks-control {
    width: 100%;
    align-items: flex-start;
}

#mainDiv.modern-dialog-card .deleted-tasks-details {
    flex: 1 1 180px;
    min-width: 0;
}

#mainDiv.modern-dialog-card .wbs-level-row > td {
    white-space: nowrap;
}

#mainDiv.modern-dialog-card .wbs-level-row > td:first-child {
    width: 38%;
}

#mainDiv.modern-dialog-card .wbs-level-row > td:last-child {
    width: 62%;
}

#mainDiv.modern-dialog-card .wbs-level-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    min-width: 0;
}

#mainDiv.modern-dialog-card .wbs-level-controls #WBSLvlName {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 100px;
}

#mainDiv.modern-dialog-card .wbs-level-controls .smallbutton {
    flex: 0 0 34px;
}

#mainDiv.modern-dialog-card .wbs-level-controls .cleardata {
    position: static;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
}

#mainDiv.modern-dialog-card .criteria-actions {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
    z-index: 12;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.98) !important;
    border-top: 1px solid var(--ui-border);
    box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
}

#mainDiv.modern-dialog-card input[type="text"],
#mainDiv.modern-dialog-card input[type="password"],
#mainDiv.modern-dialog-card input[type="number"],
#mainDiv.modern-dialog-card select {
    min-height: 34px;
    padding: 6px 9px;
}

#mainDiv.modern-dialog-card input[type="button"],
#mainDiv.modern-dialog-card input[type="submit"] {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 12px;
}

#mainDiv.modern-dialog-card input[type="checkbox"],
#mainDiv.modern-dialog-card input[type="radio"] {
    width: 16px;
    height: 16px;
}

.dialog-heading {
    margin: 0;
    color: var(--ui-text);
    font-size: 20px;
    font-weight: 700;
}

.dialog-subtitle {
    margin: 5px 0 0;
    color: var(--ui-text-muted);
    font-size: 13px;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ui-border);
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--ui-border);
}

.main-ui.modern-dialog-card {
    width: min(680px, calc(100vw - 40px));
    max-width: none;
    max-height: calc(100vh - 56px);
    min-height: 0;
    padding: 24px;
    overflow: auto;
}

.main-ui.modern-dialog-card .content {
    min-height: 340px;
    margin-bottom: 18px;
}

.main-ui.modern-dialog-card .footer input[type="button"],
.custom-container.modern-dialog-card .footer input[type="button"] {
    min-height: 40px;
    padding: 9px 16px;
    color: #ffffff;
    background: var(--ui-primary);
    border: 1px solid var(--ui-primary);
    border-radius: var(--ui-radius-sm);
    font-size: 14px;
    font-weight: 650;
}

.main-ui.modern-dialog-card .footer input[type="button"].button-secondary,
.custom-container.modern-dialog-card .footer input[type="button"].button-secondary {
    color: #334155;
    background: #ffffff;
    border-color: var(--ui-border-strong);
}

.custom-container.modern-dialog-card {
    width: min(680px, calc(100vw - 40px));
    max-width: none;
    max-height: calc(100vh - 56px);
    padding: 24px;
    overflow: auto;
}

.custom-container.modern-dialog-card .header {
    margin: 0 0 18px;
    padding: 0 0 14px;
    text-align: left;
    border-bottom: 1px solid var(--ui-border);
}

.custom-container.modern-dialog-card .header h2 {
    margin: 0;
    color: var(--ui-text);
    font-size: 20px;
}

.custom-container.modern-dialog-card .custom-content {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
}

.custom-container.modern-dialog-card .add-row {
    display: flex;
    justify-content: flex-end;
    float: none;
    margin-bottom: 10px;
}

.custom-container.modern-dialog-card #addRowButton {
    width: 34px;
    height: 34px;
    padding: 7px;
    background: var(--ui-primary-soft);
    border-radius: 9px;
    cursor: pointer;
    transition: transform 150ms ease, background-color 150ms ease;
}

.custom-container.modern-dialog-card #addRowButton:hover {
    background: #99f6e4;
    transform: translateY(-1px);
}

.custom-container.modern-dialog-card #customJqxgrid {
    width: 100% !important;
}

#Grid.modern-dialog-card {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(620px, calc(100vw - 40px));
    height: min(520px, calc(100vh - 56px));
    padding: 22px;
    transform: translate(-50%, -50%);
}

#Grid.modern-dialog-card .grid-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
    color: var(--ui-text);
    border-bottom: 1px solid var(--ui-border);
    font-family: inherit;
    font-size: 19px;
}

#Grid.modern-dialog-card #btnClose {
    width: 28px;
    height: 28px;
    padding: 6px;
    background: #f1f5f9;
    border-radius: 8px;
}

#Grid.modern-dialog-card #jqxWidgetWBSLevels {
    height: calc(100% - 54px) !important;
    margin: 0;
}

.genealogy-dialog {
    width: min(560px, calc(100vw - 40px));
    max-height: calc(100vh - 80px);
    margin: 0 auto;
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.genealogy-dialog::before {
    display: block;
    margin-bottom: 16px;
    color: var(--ui-text);
    font-size: 20px;
    font-weight: 700;
    content: "Select genealogy";
}

.genealogy-dialog #jqxGenoGrid {
    width: 100% !important;
    min-height: 260px;
    max-height: calc(100vh - 190px);
    margin: 0 !important;
    flex: 1 1 auto;
}

.genealogy-dialog #jqxGenoGrid,
.genealogy-dialog #jqxGenoGrid .jqx-widget,
.genealogy-dialog #jqxGenoGrid .jqx-widget-content,
.genealogy-dialog #jqxGenoGrid .jqx-widget-header,
.genealogy-dialog #jqxGenoGrid .jqx-fill-state-normal,
.genealogy-dialog #jqxGenoGrid .jqx-item {
    box-sizing: content-box;
}

.genealogy-dialog #jqxGenoGrid .jqx-input-group {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--ui-border-strong);
    border-radius: 7px;
    box-sizing: border-box;
}

.genealogy-dialog #jqxGenoGrid .jqx-input-group > input.jqx-input {
    float: left;
    width: calc(100% - 34px) !important;
    min-height: 0;
    height: 20px !important;
    padding: 1px 8px !important;
    background: #ffffff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

.genealogy-dialog #jqxGenoGrid .jqx-input-group > .jqx-input-group-addon {
    float: right;
    width: 32px;
    height: 20px !important;
    padding: 1px 7px !important;
    background: #f8fafc !important;
    border: 0 !important;
    border-left: 1px solid var(--ui-border) !important;
    box-sizing: border-box !important;
}

.genealogy-dialog #jqxGenoGrid .jqx-icon-search {
    display: block;
    width: 16px;
    height: 16px;
    margin: 1px auto 0;
    background-position: center;
    background-repeat: no-repeat;
}

.genealogy-dialog #jqxGenoGrid .filtercolumns {
    overflow: hidden;
    border: 1px solid var(--ui-border-strong) !important;
    border-radius: 7px !important;
    box-sizing: border-box !important;
}

.genealogy-dialog #jqxGenoGrid #bottomRight {
    visibility: hidden !important;
    pointer-events: none;
}

.configuration-card {
    width: min(520px, calc(100% - 40px));
    margin: 48px auto;
    padding: 28px;
}

.configuration-card table {
    width: 100%;
    border-spacing: 0 14px;
    border-collapse: separate;
}

.configuration-card td:first-child {
    padding-right: 18px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-main {
        height: 58vh !important;
        min-height: 420px;
    }

    .dashboard-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-actions::before {
        grid-column: 1 / -1;
    }

}

@media (max-width: 760px) {
    #mainDiv.modern-dialog-card {
        width: calc(100vw - 24px) !important;
        height: calc(100dvh - 24px) !important;
        max-height: calc(100dvh - 24px) !important;
    }

    #mainDiv.modern-dialog-card.criteria-dialog-import {
        height: auto !important;
    }

    #mainDiv.modern-dialog-card > .criteria-dialog-content {
        display: block;
    }

    #mainDiv.modern-dialog-card > .criteria-dialog-content > .fieldsSec {
        border-right: 0 !important;
        border-bottom: 1px solid var(--ui-border) !important;
    }
}

@media (max-width: 640px) {
    .app-header {
        min-height: 60px;
        padding: 10px 16px;
    }

    .app-header img {
        max-width: 105px;
    }

    .app-page,
    .dashboard-layout,
    .transfer-layout,
    .circular-reference-panel {
        width: calc(100% - 24px) !important;
        margin-top: 16px !important;
    }

    .app-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .app-toolbar input[type="button"] {
        width: 100%;
    }

    .app-form-card {
        padding: 22px !important;
    }

    .app-form-table,
    .app-form-table tbody,
    .app-form-table tr,
    .app-form-table td {
        display: block;
        width: 100% !important;
    }

    .app-form-table {
        border-spacing: 0;
    }

    .app-form-table tr {
        margin-bottom: 14px;
    }

    .app-form-table td:first-child {
        padding: 0 0 6px;
    }

    .dashboard-main {
        height: 52vh !important;
        min-height: 360px;
        padding: 12px !important;
    }

    .dashboard-actions {
        display: flex !important;
    }

    .circular-reference-panel__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .transfer-main {
        padding: 12px !important;
    }

    .transfer-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .transfer-actions input[type="button"] {
        width: 100%;
    }

    .modal {
        padding: 12px !important;
    }

    #mainDiv.modern-dialog-card,
    .main-ui.modern-dialog-card,
    .custom-container.modern-dialog-card,
    #Grid.modern-dialog-card,
    .genealogy-dialog {
        width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 24px) !important;
        border-radius: 14px !important;
    }

    #mainDiv.modern-dialog-card > .criteria-dialog-content > .fieldsSec,
    #mainDiv.modern-dialog-card > .criteria-dialog-content > .mappingSec {
        padding: 18px !important;
    }

    #mainDiv.modern-dialog-card td {
        padding: 7px 5px;
    }

    #mainDiv.modern-dialog-card .fieldsSec td:first-child {
        min-width: 112px;
    }

    #mainDiv.modern-dialog-card .wbs-level-controls #WBSLvlName {
        min-width: 100px;
    }

    #mainDiv.modern-dialog-card .deleted-tasks-control {
        flex-wrap: wrap;
    }

    #mainDiv.modern-dialog-card .deleted-tasks-row-content {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    #mainDiv.modern-dialog-card .deleted-tasks-details {
        width: 100%;
    }

    #mainDiv.modern-dialog-card .deleted-tasks-text {
        width: 100%;
        min-width: 0;
    }

    .configuration-card {
        width: calc(100% - 24px);
        margin: 20px auto;
        padding: 20px;
    }

    .configuration-card table,
    .configuration-card tbody,
    .configuration-card tr,
    .configuration-card td {
        display: block;
        width: 100%;
    }

    .configuration-card td:first-child {
        padding: 0 0 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
