html, body {
    height: 100%;
    overflow: hidden;
}

html {

    min-width: 300px;
}

body {
    font-size: var(--font-size);
    margin: 0;
    padding: 0;
    color: var(--color-text);

    background: linear-gradient(180deg, #f8fafc 0%, #f4f7fb 100%);
    /*background-image:
            linear-gradient(90deg, rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.58)),
            url("../2_res/background.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;*/
}

body, body * {
    font-family: var(--font-main), serif;
}

body::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 0%, rgba(37, 99, 235, 0.08), transparent 34rem);
    z-index: 0;
    pointer-events: none;
}

.green {
    color: green !important;
}

.orange {
    color: orange !important;
}

/**
 * GLOBALs
 */
*[class*=":verticalTop"] {
    display: inline-block;
    vertical-align: top;
}

*[class*=":padding075vh"] {
    padding: 0.75vh 0.75vh;
}

*[class*=":rounded"] {
    border-radius: 50%;
    width: 30px !important;
    height: 30px !important;
    font-size: 15px;
}

*[class*=":middleItems"] {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

*[class*=":pointer"] {
    cursor: pointer;
}

*[class*=":bold"] {
    font-weight: bold;
}

*[class*=":noSelect"], *[class*=":noSelect"] * {
    user-select: none;
}

*[class*=":noDark"] {
    color: black !important;
}

*[class*=":inlineBlock"] {
    display: inline-block;
}

/**
 * BUTTONs / INPUTs
 */
button {
    user-select: none;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

input:not(input[type='checkbox']), button:not(.global-button-scroll), select, textarea {
    border-radius: var(--radius);
    margin: 0.3rem 0.3rem 0.3rem 0.3rem;
    padding: 0.3rem;
    min-height: 1vh;

    border: 1px solid #dbe3ef;
    background-color: rgba(255, 255, 255, 0.98);

    transition:
            background-color 0.15s ease,
            color 0.15s ease,
            border-color 0.15s ease,
            transform 0.2s ease,
            box-shadow 0.15s ease,
            opacity 0.15s ease;
}

input:not[type="checkbox"], select, textarea {
    min-width: 20vh;
    width: 20vh;
}

select, input[type="color"] {
    min-width: 21vh;
}

input:not([disabled]):hover, button:not([disabled]):hover, input:not([disabled]):focus, button:not([disabled]):focus, select:not([disabled]):hover, select:not([disabled]):focus {
    transform: scale(1.005);
}

input {
    cursor: text;
    margin: 0.5vh;
}

input[type="checkbox"], input[type="radio"], input[type="color"], input[type="range"], select {
    cursor: pointer;
}

input[type="checkbox"], input[type="radio"] {
    width: auto !important;
    margin-bottom: 15px;
}

input:hover, input:focus, select:hover, select:focus {
    border: 1px solid #93b4e8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    outline: none;
}

button, input[type="submit"], button i, button label {
    cursor: pointer;
}

button {
    color: #172033;

    border-color: #dbe3ef;
    background: #ffffff;

    letter-spacing: 0.01em;

    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

button:not([disabled]):hover,
input[type="submit"]:not([disabled]):hover,
input[type="submit"]:not([disabled]):focus {
    background: linear-gradient(135deg, var(--color-secondardy), var(--color-primary));
    color: white;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

button:disabled,
input[type="submit"]:disabled {
    color: #9ca3af;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.75;
}

.global-button-editable {
    cursor: pointer;
}

.global-label-pre {
    display: inline-block;
    width: 25vh;
    overflow: hidden;
    user-select: none;
    vertical-align: top;
}

.global-button-scroll {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    z-index: 999;
    height: 2.75rem;
    width: 2.75rem;
    font-size: 1rem;
}

/**
 * LABELs
 */
label {
    display: inline-block;
    vertical-align: middle;
    -webkit-text-size-adjust: 100%;
}

/**
 * ULs
 */
ul {
    margin: 2px;
}

ul, ul * {
    cursor: default !important;
}

/**
 * DIVs
 */
.global-content {
    display: block;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 14rem;
    top: 3.25rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.global-editable, .global-data {
    box-sizing: border-box;
    display: block;
    position: absolute;
    height: calc(50% - 1.25vh);
    width: 100%;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: auto;
    padding: 1.5rem 2rem 3rem;
    border: none;
}

.global-editable-fullHeight {
    height: 100% !important;
}

.global-editable {
    top: 0;
}

.global-data {
    bottom: 0;
}

.global-data-color {
    display: block;
    height: 1.5vh;
    border-radius: var(--radius);
    border: 1px solid white;
}

.global-div-tab {
    display: inline-block;
    border-top: 1px solid lightgray;
    border-left: 1px solid lightgray;
    border-right: 1px solid lightgray;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    padding: 0.25vh 0.25vh 0.25vh 0.5vh;
    background-color: white;
    margin-bottom: 0;
}

.global-div-tab, .global-div-tab * {
    cursor: pointer;
    user-select: none;
}

.global-div-tab.active {
    color: var(--color-primary);
}

.global-div-tab:hover {
    background-color: #2563eb;
    color: #ffffff;
}

.global-div-tab-content {
    display: none;
}

.tab-active {
    display: block !important;
}

/**
 * TABLEs
 */
.global-data-table {
    width: calc(100% - 0.25vh);
    height: auto;
    max-height: 100%;
    border-collapse: collapse;
    border: 1px solid lightgray;
    border-radius: var(--radius);
    overflow: auto;
    user-select: none;
}

.global-data-table th, .global-data-table td {
    border: 1px solid lightgray;
    text-align: center;
    padding: 0.25vh;
}

.global-data-table tbody tr:hover td, .global-data-table tbody tr:hover td::before {
    background-color: var(--color-secondardy);
    color: var(--color-secondardy-hover) !important;
    cursor: pointer;
}

.tasks-additional-tabs {
    border-bottom: 1px solid lightgray;
}

/**
 * IMAGES
 */
.global-wait {
    position: fixed;
    right: 0;
    top: 0;
    height: 10vh;
    z-index: 99999;
    display: none;
}

.global-loading {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.58);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(2px);
    transition: opacity 0.16s ease;
}

.global-loading.show {
    opacity: 1;
    pointer-events: auto;
}

.global-loading-card {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid #dbe3ef;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
}

.global-loading-card label {
    margin: 0;
    padding: 0;
    color: #172033;
    font-weight: 900;
}

.global-loading-spinner {
    width: 1.6rem;
    height: 1.6rem;
    border: 0.22rem solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 999px;
    animation: globalLoadingSpin 0.75s linear infinite;
}

.system-status-banner {
    position: fixed;
    top: 3.25rem;
    left: 14rem;
    right: 0;
    z-index: 900;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 3.1rem;
    padding: 0.55rem 1.25rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
    background: #eff6ff;
    color: #172033;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
    overflow: hidden;
}

.system-status-banner i {
    margin-top: 0.18rem;
    font-size: 1.1rem;
}

.system-status-banner div {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.system-status-banner strong {
    font-size: 0.86rem;
    line-height: 1.1;
}

.system-status-banner span {
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.22;
}

.system-status-banner small {
    color: rgba(23, 32, 51, 0.72);
    font-size: 0.76rem;
    font-weight: 800;
}

.system-status-banner.maintenance,
.system-status-banner.update {
    background: #fef3c7;
    color: #78350f;
}

.system-status-banner.update::after {
    content: "";
    position: absolute;
    left: -35%;
    right: auto;
    bottom: 0;
    width: 35%;
    height: 0.18rem;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.55;
    animation: systemStatusUpdateBar 1.35s linear infinite;
}

.system-status-banner.update i {
    animation: systemStatusUpdateSpin 1.1s linear infinite;
}

.system-status-banner.degraded,
.system-status-banner.testmode {
    background: #ffedd5;
    color: #7c2d12;
}

.system-status-banner.error {
    background: #fee2e2;
    color: #7f1d1d;
}

body.has-system-status-banner .global-content {
    top: 6.35rem;
}

body.has-system-status-banner .global-button-scroll {
    bottom: 20px;
}

body.has-system-status-banner .dialog-from-top.show {
    top: 4.2rem;
}

body.has-system-status-banner .global-loading {
    padding-top: 3.1rem;
}

body.nav-is-small.has-system-status-banner .system-status-banner {
    left: 4rem;
}

@media (max-width: 900px) {
    .system-status-banner {
        left: 0;
        padding: 0.55rem 0.85rem;
    }

    body.has-system-status-banner .global-content {
        top: 6.55rem;
    }
}

@keyframes globalLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes systemStatusUpdateSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes systemStatusUpdateBar {
    to {
        left: 100%;
    }
}

/**
 * FIELDSETs
 */
.global-fieldset {
    border-radius: var(--radius);
    border: 1px solid lightgray;
    padding: 0.5vh;
    margin-top: 15px;
    margin-bottom: 15px;
}

/**
 * Shared modern page surfaces
 */
body:not(.page-tasks) .global-editable:not(.global-editable-fullHeight),
body:not(.page-tasks) .global-data {
    left: 2rem;
    right: 2rem;
    width: auto;
    padding: 1rem 1.15rem;
    border: 1px solid #e6edf6;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

body:not(.page-tasks) .global-editable:not(.global-editable-fullHeight) {
    top: 1.5rem;
    height: calc(50% - 2.25rem);
}

body:not(.page-tasks) .global-data {
    bottom: 1.5rem;
    height: calc(50% - 2.25rem);
}

body:not(.page-tasks):not(.page-flightmap) .global-editable-fullHeight {
    padding: 1.5rem 2rem 3rem;
}

body:not(.page-tasks) .global-editable:not(.global-editable-fullHeight) .defaultButtons-table {
    margin-bottom: 0.9rem;
}

body:not(.page-tasks) .global-editable:not(.global-editable-fullHeight) .defaultButtons-div,
body:not(.page-tasks) .global-editable-fullHeight > .defaultButtons-table .defaultButtons-div {
    justify-content: flex-start;
}

body:not(.page-tasks) .global-label-pre {
    width: 14rem;
    max-width: 100%;
    padding: 0.45rem 0.7rem 0.45rem 0;
    color: #64748b;
    font-weight: 800;
}

body:not(.page-tasks) .global-editable input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body:not(.page-tasks) .global-editable select,
body:not(.page-tasks) .global-editable textarea,
body:not(.page-tasks) .dialog-full-size input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body:not(.page-tasks) .dialog-full-size select,
body:not(.page-tasks) .dialog-full-size textarea {
    box-sizing: border-box;
    min-width: min(22rem, 100%);
    min-height: 2.45rem;
    margin: 0.22rem 0.45rem 0.55rem 0;
    padding: 0.65rem 0.85rem;
    border-radius: 0.55rem;
}

body:not(.page-tasks) .global-editable input[type="color"] {
    min-width: 4rem;
    width: 5.5rem;
    padding: 0.15rem;
}

body:not(.page-tasks) .global-editable input[type="checkbox"],
body:not(.page-tasks) .global-editable input[type="radio"],
body:not(.page-tasks) .dialog-full-size input[type="checkbox"],
body:not(.page-tasks) .dialog-full-size input[type="radio"] {
    width: 1.1rem !important;
    height: 1.1rem;
    margin: 0.65rem 0.65rem 0.65rem 0;
    accent-color: #16a34a;
}

body:not(.page-tasks) .global-editable input:disabled,
body:not(.page-tasks) .global-editable select:disabled,
body:not(.page-tasks) .global-editable textarea:disabled,
body:not(.page-tasks) .dialog-full-size input:disabled,
body:not(.page-tasks) .dialog-full-size select:disabled,
body:not(.page-tasks) .dialog-full-size textarea:disabled,
.dialog-from-top input:disabled,
.dialog-from-top select:disabled,
.dialog-from-top textarea:disabled {
    background: repeating-linear-gradient(
            -45deg,
            #f1f5f9,
            #f1f5f9 8px,
            #e8eef6 8px,
            #e8eef6 16px
    ) !important;
    border-style: dashed !important;
    border-color: #94a3b8 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
    opacity: 0.9;
}

body.darkmode:not(.page-tasks) .global-editable input:disabled,
body.darkmode:not(.page-tasks) .global-editable select:disabled,
body.darkmode:not(.page-tasks) .global-editable textarea:disabled,
body.darkmode:not(.page-tasks) .dialog-full-size input:disabled,
body.darkmode:not(.page-tasks) .dialog-full-size select:disabled,
body.darkmode:not(.page-tasks) .dialog-full-size textarea:disabled,
body.darkmode .dialog-from-top input:disabled,
body.darkmode .dialog-from-top select:disabled,
body.darkmode .dialog-from-top textarea:disabled {
    background: repeating-linear-gradient(
            -45deg,
            #252b33,
            #252b33 8px,
            #1f252d 8px,
            #1f252d 16px
    ) !important;
    border-color: #64748b !important;
    color: #94a3b8 !important;
}

body:not(.page-tasks) .global-fieldset {
    border: 1px solid #e6edf6;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    padding: 0.9rem;
}

body:not(.page-tasks) .global-fieldset legend {
    color: #172033;
    font-weight: 800;
    padding: 0 0.45rem;
}

body:not(.page-tasks) .global-data-table {
    width: 100%;
    border-radius: 0.75rem;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: #ffffff;
    padding: 0.5vh;
}

body:not(.page-tasks) .global-data-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #dbe3ef;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

body:not(.page-tasks) .global-data-search > i {
    color: #64748b;
}

body:not(.page-tasks) .global-data-search input {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}

body:not(.page-tasks) .global-data-search button {
    display: none;
    width: 2rem;
    height: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #475569;
}

body:not(.page-tasks) .global-data-search.has-value button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body:not(.page-tasks) .global-data-table th,
body:not(.page-tasks) .global-data-table td {
    border: none;
    border-bottom: 1px solid #eef3f8;
    padding: 0.65rem 0.8rem;
    text-align: left;
}

body:not(.page-tasks) .global-data-table th {
    color: #475569;
    background: #f8fafc;
    font-weight: 800;
}

body:not(.page-tasks) .global-data-table tbody tr:hover td,
body:not(.page-tasks) .global-data-table tbody tr:hover td::before {
    background: #dbeafe;
    color: #1d4ed8 !important;
}

body.darkmode:not(.page-tasks) .global-editable:not(.global-editable-fullHeight),
body.darkmode:not(.page-tasks) .global-data,
body.darkmode:not(.page-tasks) .global-fieldset,
body.darkmode:not(.page-tasks) .global-data-search,
body.darkmode:not(.page-tasks) .global-data-table {
    background: var(--darkmode-surface-color);
    color: var(--darkmode-text-color);
    border-color: var(--darkmode-border-color);
    box-shadow: var(--darkmode-shadow);
}

body.darkmode:not(.page-tasks) .global-label-pre,
body.darkmode:not(.page-tasks) .global-data-table th,
body.darkmode:not(.page-tasks) .global-data-search > i {
    color: var(--darkmode-muted-color);
}

body.darkmode:not(.page-tasks) .global-data-table th {
    background: var(--darkmode-surface-color-soft);
}

body.darkmode:not(.page-tasks) .global-data-table th,
body.darkmode:not(.page-tasks) .global-data-table td {
    border-bottom-color: var(--darkmode-border-color-soft);
}

body.darkmode:not(.page-tasks) .global-data-table tbody tr:hover td,
body.darkmode:not(.page-tasks) .global-data-table tbody tr:hover td::before {
    background: var(--darkmode-surface-color-hover);
    color: white !important;
}

/**
 * MEDIA
 */
@media (max-width: 950px) {
    .global-content {
        left: 9.1rem;
    }

    body:not(.page-tasks) .global-editable:not(.global-editable-fullHeight),
    body:not(.page-tasks) .global-data {
        left: 0.75rem;
        right: 0.75rem;
        padding: 0.75rem;
    }

    body:not(.page-tasks):not(.page-flightmap) .global-editable-fullHeight {
        padding: 0.75rem;
    }
}

@media (max-width: 650px) {
    .global-content {
        left: 4.6rem;
        right: 0;
    }

    input:not[type="range"], textarea {
        width: calc(100% - 2vh);
    }

    button {
        margin: 0.2rem;
    }

    body:not(.page-tasks) .global-editable:not(.global-editable-fullHeight),
    body:not(.page-tasks) .global-data {
        left: 0.45rem;
        right: 0.45rem;
        padding: 0.55rem;
    }

    body:not(.page-tasks):not(.page-flightmap) .global-editable-fullHeight {
        padding: 0.55rem;
    }

    .global-data-table {
        border: none;
    }

    .global-data-table thead {
        display: none;
    }

    .global-data-table,
    .global-data-table tbody,
    .global-data-table tr,
    .global-data-table td {
        display: block;
        text-align: start;
        color: black;
    }

    .global-data-table tr {
        margin-bottom: 0.45rem;
        border-radius: 8px;
        padding: 0.45rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .global-data-table td {
        padding: 0.3rem 0.45rem;
        border: none;
    }

    .global-data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        color: #555;
    }

    .global-label-pre {
        width: 15vh;
    }
}

.global-content.big {
    left: 4.6rem;
    right: 0;

    input {
        width: calc(100% - 2vh);
    }

    input[type="color"] {
        width: calc(100% - 1vh);
    }

    button {
        margin: 0.2rem;
    }

    .global-data-table {
        border: none;
    }

    .global-data-table thead {
        display: none;
    }

    .global-data-table,
    .global-data-table tbody,
    .global-data-table tr,
    .global-data-table td {
        display: block;
        text-align: start;
    }

    .global-data-table tr {
        margin-bottom: 0.45rem;
        border-radius: 8px;
        padding: 0.45rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .global-data-table td {
        padding: 0.3rem 0.45rem;
        border: none;
    }

    .global-data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        color: #555;
    }
}

/**
 * Mobile table scrolling / dark readability
 */
@media (max-width: 650px) {
    .global-data {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .global-data-table {
        display: block;
        width: 100%;
        max-height: none;
        overflow: visible;
    }

    .global-data-table tbody {
        display: block;
        overflow: visible;
    }

    .global-data-table tr {
        background: #ffffff;
        border: 1px solid #e6edf6;
    }

    .global-data-table td,
    .global-data-table td::before {
        color: #172033;
    }

    body.darkmode .global-data-table tr {
        background: var(--darkmode-surface-color-soft);
        border-color: var(--darkmode-border-color);
        box-shadow: var(--darkmode-shadow-soft);
    }

    body.darkmode .global-data-table td {
        color: var(--darkmode-text-color);
    }

    body.darkmode .global-data-table td::before {
        color: var(--darkmode-muted-color);
    }
}

/**
 * BADGES for messages
 */
.header-user-icon {
    font-size: 13pt;
    margin: 2px 4px 4px;
}

.unreaded-messages-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    margin-left: 0.4rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background-color: #d93025;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    line-height: 1;
    vertical-align: middle;
}

.header-labels {
    display: flex;
    max-width: 55%;
    overflow: hidden;
}

