/* Ensure the body and html elements take full height */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    background-color: #060606;
    color: white;
    padding-top: 70px;
    padding-bottom: 56px;
}

/* Header styles */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #1A2C5B;
    padding: 10px 0;
    color: white;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 70px;
}

.header-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

/* Responsive header for larger screens */
@media (min-width: 768px) {
    .header-title {
        font-size: 28px;
    }

    .header-logo {
        height: 80px;
    }
}

/* Tablet/Small screen responsiveness */
@media (max-width: 1024px) {
    .skills-top-row {
        grid-template-columns: 1fr;
    }

    .skills-divider,
    .skills-top-row>.user-info-container::after {
        display: none;
    }

    .skills-container {
        gap: 15px;
    }

    .base-container .top {
        display: none !important;
    }

    .base-container {
        overflow-y: scroll !important;
    }
}

/* Vertical height responsiveness - progressive padding removal */
@media (max-height: 750px) {
    .base-container .top {
        display: none !important;
    }
}

@media (max-height: 700px) {
    .skills-container {
        padding: 0 !important;
    }
}

@media (max-height: 647px) {
    .base-container>.middle {
        padding: 0 !important;
    }
}

@media (max-height: 620px) {
    .base-container {
        padding: 0 !important;
    }
}

@media (max-height: 600px) {

    html,
    body {
        padding-top: 55px;
    }
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .container {
        margin: 10px;
        padding: 15px;
    }

    .skills-top-row {
        grid-template-columns: 1fr;
    }

    .skills-divider,
    .skills-top-row>.user-info-container::after {
        display: none;
    }

    .skills-container {
        gap: 15px;
    }

    .team-assignment-row {
        width: 100%;
    }

    .status-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .header-title {
        font-size: 20px;
    }

    .header-logo {
        height: 60px;
    }
}

/* Footer styles */
.footer {
    background: linear-gradient(135deg, #1a2c5b 0%, #0f1a3a 100%);
    border: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.footer p {
    color: #ffffff;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    opacity: 0.8;
}

.version-badge {
    background: #00af00;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.9;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .footer-content {
        flex-direction: column;
        gap: 5px;
        padding: 6px 15px;
    }

    .footer p {
        font-size: 12px;
    }

    .version-badge {
        font-size: 10px;
        padding: 1px 6px;
    }
}

/* Container settings */
.container {
    min-width: 300px;
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background-color: #1A2C5B;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Base container for main content */
.base-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    justify-content: flex-start;
    overflow: visible;
}

.base-container>.top,
.base-container>.bottom {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 10px 10px 10px;
}

.base-container>.top {
    padding: 15px 10px;
}

.base-container>.middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
    box-sizing: border-box;
}

.base-container>.bottom {
    margin-bottom: 80px;
    justify-content: top;
}

/* Form styles */
h1,
h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
}

label {
    font-weight: bold;
    margin-top: 10px;
    display: block;
    white-space: nowrap;
}

/* Form and input elements */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 98.5%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #BBB;
    border-radius: 5px;
    background-color: #e6e6e6;
    color: #333;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
textarea:focus {
    border-color: #00af00;
    background-color: #f5f5f5;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 175, 0, 0.3);
}

select:focus {
    border-color: #00af00;
    background-color: #1A2C5B;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 175, 0, 0.3);
}

/* Button styles */
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #00af00;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    width: 309px;
    min-height: 40px;
    height: 40px;
    margin-top: 20px;
    text-align: center;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #00c400;
}

.submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 175, 0, 0.3);
}

/* Skills container */
.skills-container {
    display: flex;
    flex-direction: column;
    width: min(1400px, 100%);
    gap: 12px;
    padding: 10px 14px 6px;
    background-color: #060606;
    color: white;
}

.skills-top-row {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(560px, 1.45fr) 56px minmax(250px, 0.95fr) 56px minmax(250px, 0.95fr);
    column-gap: 10px;
    row-gap: 12px;
    align-items: stretch;
}

.skills-top-row.no-acd-layout {
    grid-template-columns: minmax(560px, 1.45fr) 56px minmax(540px, 1.35fr);
}

.skills-top-row>* {
    min-width: 0;
}

.skills-top-row>.user-info-container {
    position: relative;
}

.skills-top-row>.user-info-container::after {
    display: none;
}

.skills-divider {
    width: 1px;
    height: auto;
    margin-top: 28px;
    align-self: stretch;
    justify-self: center;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 999px;
}

/* Select styles for skills section */
select {
    width: 250px;
    height: 380px;
    background-color: #1A2C5B;
    color: white;
    border: 1px solid white;
    border-radius: 5px;
    padding: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

select:focus {
    background-color: #1A2C5B;
    border-color: grey;
    outline: none;
}

/* Arrow buttons */
.arrow-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-top: 0;
}

.arrow-buttons img {
    cursor: pointer;
}

.arrow-container {
    position: relative;
    width: 52px;
    height: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.arrow-button {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
    outline: none;
    transition: color 0.3s, transform 0.2s;
}

.arrow-button:focus {
    outline: none;
}

.arrow-button:hover {
    color: #00c400;
    transform: scale(1.1);
}

.arrow-button:active {
    transform: scale(0.95);
}

/* Arrow Lottie styles */
#assign-lottie,
#unassign-lottie {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    display: none;
}

/* Skills section alignment */
.skills-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.skills-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.skills-column-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 390px;
    padding: 12px;
    background: linear-gradient(170deg, #223a74 0%, #172d61 55%, #142650 100%);
    border-radius: 12px;
    border: 1px solid rgba(205, 226, 255, 0.26);
    box-shadow: 0 8px 18px rgba(5, 11, 28, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
}

/* Keep skill columns visually light so headers sit outside like the legacy layout */
.assigned-skills .skills-column-card,
.unassigned-skills .skills-column-card {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.skills-column-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    height: 100%;
}

.skills-column-label {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0;
    text-transform: none;
}

.skills-arrow-column {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
}

.skills-arrow-column .arrow-buttons {
    height: 380px;
    gap: 8px;
}

.assigned-skills {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.unassigned-skills {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.unassigned-skills select {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.assigned-skills-list {
    width: 100%;
    height: 100%;
    min-height: 0;
    background-color: #1A2C5B;
    color: white;
    border: 1px solid white;
    border-radius: 5px;
    padding: 6px;
    margin: 0;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.assigned-skills-list.skills-loading {
    animation: shimmer-border 1.4s ease-in-out infinite;
    border: 2px solid rgba(100, 160, 255, 0.50);
    opacity: 0.6;
    cursor: wait;
}

.assigned-skills-list.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.assigned-skill-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.assigned-skill-row:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
}

.assigned-skill-row.selected {
    background: rgba(0, 175, 0, 0.18);
    border-color: rgba(0, 196, 0, 0.55);
}

.assigned-skill-row.saving {
    opacity: 0.7;
}

.assigned-skill-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.2;
    word-break: break-word;
}

.assigned-skill-row .competence-badge-select {
    flex: 0 0 auto;
    width: 52px;
    min-width: 52px;
    height: 24px;
    margin: 0;
    padding: 1px 18px 1px 6px;
    border-radius: 999px;
    border: 1px solid rgba(119, 160, 220, 0.4);
    background: linear-gradient(135deg, rgba(33, 56, 107, 0.94) 0%, rgba(21, 38, 78, 0.94) 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
    line-height: 1.1;
    -moz-appearance: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    text-indent: 0;
    text-overflow: "";
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
        linear-gradient(135deg, rgba(33, 56, 107, 0.94) 0%, rgba(21, 38, 78, 0.94) 100%);
    background-repeat: no-repeat, no-repeat;
    background-position: right 6px center, center;
    background-size: 11px 8px, auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.assigned-skill-row .competence-badge-select::-ms-expand {
    display: none;
}

.assigned-skill-row .competence-badge-select option {
    color: #e6eeff;
    background: #162650;
    font-weight: 600;
}

.assigned-skill-row .competence-badge-select:focus {
    border-color: #7cc5ff;
    box-shadow: 0 0 0 2px rgba(124, 197, 255, 0.2);
}

.assigned-skills-hint {
    color: rgba(255, 255, 255, 0.74);
    font-size: 12px;
    line-height: 1.5;
}

.skill-list-empty {
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
    padding: 14px 10px;
    text-align: center;
}

.assigned-skills select.skills-loading,
.unassigned-skills select.skills-loading {
    animation: shimmer-border 1.4s ease-in-out infinite;
    border: 2px solid rgba(100, 160, 255, 0.50);
    opacity: 0.6;
    cursor: wait;
}

/* Resource section */
.resource-section {
    flex: 1;
    width: 100%;
    min-width: auto;
    max-width: 560px;
    min-height: 390px;
    padding: 14px;
    background: linear-gradient(170deg, #223a74 0%, #172d61 55%, #142650 100%);
    border-radius: 12px;
    border: 1px solid rgba(205, 226, 255, 0.26);
    box-shadow: 0 8px 18px rgba(5, 11, 28, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: visible;
}

/* User info container */
.user-info-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.team-assignment-row {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    align-self: center;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
}

.user-config-status {
    margin-top: 14px;
}

.config-status-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 114, 114, 0.45);
}

.config-status-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.config-status-copy {
    font-size: 13px;
    line-height: 1.55;
    color: #f1c7c7;
}

.config-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.config-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 82, 82, 0.18);
    border: 1px solid rgba(255, 82, 82, 0.32);
    color: #ffd7d7;
    font-size: 11px;
    font-weight: 700;
}

.config-request-button {
    align-self: flex-start;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.team-assignment-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.team-assignment-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    padding: 8px;
    background: linear-gradient(170deg, #223a74 0%, #172d61 55%, #142650 100%);
    border-radius: 10px;
    border: 1px solid rgba(205, 226, 255, 0.26);
    box-shadow: 0 6px 14px rgba(5, 11, 28, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.team-assignment-section select {
    width: 280px;
    height: auto;
    min-height: 36px;
    margin: 0;
    padding-right: 34px;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 12px 8px;
}

.team-assignment-section select::-ms-expand {
    display: none;
}

.team-update-button {
    min-width: 108px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #1a2c5b;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    box-sizing: border-box;
}

.team-update-button:hover:not(:disabled) {
    background: #244289;
}

.team-update-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.team-update-button:active:not(:disabled) {
    transform: scale(0.96);
    background: #1a2c5b;
}

.team-update-button.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.team-update-button.updated {
    background: #1a6e1a;
    border-color: rgba(100, 255, 100, 0.35);
    cursor: not-allowed;
    opacity: 0.75;
}

.uc-update-button,
.save-mask-button {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    min-height: 36px;
    height: 36px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #1a2c5b;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.uc-update-button:hover:not(:disabled),
.save-mask-button:hover:not(:disabled) {
    background: #244289;
}

.uc-update-button:disabled,
.save-mask-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.uc-update-button.loading,
.save-mask-button.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.uc-update-button.updated,
.save-mask-button.updated {
    background: #1a6e1a;
    border-color: rgba(100, 255, 100, 0.35);
    cursor: not-allowed;
    opacity: 0.75;
}

.team-selection-note {
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
    line-height: 1.5;
    min-height: 0;
    text-align: center;
}

/* Team mini card (inside ext-split-row) */
.ext-mini-card--team {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-height: 64px;
    overflow: hidden;
}

.ext-mini-card--uc {
    min-height: 64px;
    overflow: hidden;
}

.team-mini-row,
.uc-mini-row {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
}

.team-inline-selects,
.uc-inline-selects {
    display: grid;
    grid-template-columns: 284px 96px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 388px;
    max-width: 100%;
    justify-self: end;
}

.team-inline-selects #team-select,
.uc-inline-selects #uc-profile-select {
    grid-column: 1;
    width: 284px !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 36px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    padding: 6px 28px 6px 10px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(175, 206, 255, 0.35) !important;
    background-color: #1a2c5b !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 7px center !important;
    background-size: 9px 6px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    color: white !important;
    box-sizing: border-box !important;
    text-overflow: ellipsis;
}

@media (max-width: 767px) {

    .team-inline-selects,
    .uc-inline-selects {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) 96px;
    }

    .team-inline-selects #team-select,
    .uc-inline-selects #uc-profile-select {
        width: 100% !important;
    }
}

.team-inline-selects .team-update-button,
.uc-inline-selects .uc-update-button {
    grid-column: 2;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    min-height: 36px;
    height: 36px;
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 8px;
    white-space: nowrap;
    box-sizing: border-box;
}

.external-mask-controls .save-mask-button,
.team-inline-selects .team-update-button,
.uc-inline-selects .uc-update-button {
    justify-self: end;
}

.update-action-button {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box !important;
    line-height: 1;
}

/* Fixed-width device dropdown — CSF names have a bounded length */
#mask-device-select {
    flex: 0 0 160px !important;
    width: 160px !important;
}

@media (max-width: 767px) {
    .team-assignment-row {
        width: min(100%, 720px);
        padding: 0;
    }

    .team-assignment-controls {
        flex-wrap: wrap;
    }

    .team-assignment-section select {
        width: min(380px, 100%);
    }
}

.team-assignment-section>label {
    margin-top: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: #ffffff;
    align-self: center;
}

@keyframes shimmer-border {
    0% {
        border-color: rgba(255, 255, 255, 0.20);
    }

    50% {
        border-color: rgba(100, 160, 255, 0.80);
    }

    100% {
        border-color: rgba(255, 255, 255, 0.20);
    }
}

.team-assignment-section select.teams-loading {
    animation: shimmer-border 1.4s ease-in-out infinite;
    border: 2px solid rgba(100, 160, 255, 0.50);
    opacity: 0.7;
    cursor: wait;
}

.server-selection-row {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    align-self: center;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
}

.server-selection-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.server-selection-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    padding: 8px;
    background: linear-gradient(170deg, #223a74 0%, #172d61 55%, #142650 100%);
    border-radius: 10px;
    border: 1px solid rgba(205, 226, 255, 0.26);
    box-shadow: 0 6px 14px rgba(5, 11, 28, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.server-pacman-spinner {
    width: 44px;
    height: 20px;
    position: relative;
    flex: 0 0 44px;
}

.server-pacman {
    position: absolute;
    left: 0;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
}

.server-pacman::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 3px;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #0b1633;
}

.server-pacman::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 8px solid #0b1633;
    transform-origin: left center;
    transform: translate(0, -50%) rotate(25deg);
    animation: serverPacmanMouth 0.42s ease-in-out infinite;
}

.server-pellet {
    position: absolute;
    top: 8px;
    left: 20px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffd700;
}

.server-pellet-1 {
    animation: serverPelletMove 1s linear infinite;
}

.server-pellet-2 {
    left: 28px;
    animation: serverPelletMove 1s linear infinite 0.2s;
}

.server-pellet-3 {
    left: 36px;
    animation: serverPelletMove 1s linear infinite 0.4s;
}

@keyframes serverPacmanMouth {

    0%,
    100% {
        transform: translate(0, -50%) rotate(25deg);
    }

    50% {
        transform: translate(0, -50%) rotate(-25deg);
    }
}

@keyframes serverPelletMove {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    85% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(-20px);
    }
}

.server-selection-section select {
    width: 250px;
    height: auto;
    min-height: 36px;
    margin: 0;
    padding-right: 34px;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 12px 8px;
}

.server-selection-section select::-ms-expand {
    display: none;
}

.server-selection-note {
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
    line-height: 1.5;
    min-height: 0;
    text-align: center;
}

.acd-association-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.acd-status-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.acd-status-help:hover,
.acd-status-help:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    outline: none;
}

.acd-status-help:focus-visible {
    box-shadow: 0 0 0 2px #ffd54f;
}

.acd-status-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 150;
    width: 250px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 6px;
    background: #102957;
    color: #ffffff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.acd-status-help:hover .acd-status-tooltip,
.acd-status-help:focus-visible .acd-status-tooltip {
    visibility: visible;
    opacity: 1;
}

.acd-association-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.56);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: default;
}

.acd-association-indicator {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #8993a5;
}

.acd-association-badge.is-active {
    border-color: rgba(105, 222, 139, 0.8);
    background: rgba(45, 152, 80, 0.3);
    color: #e2ffe9;
    box-shadow: 0 0 9px rgba(76, 204, 110, 0.25);
}

.acd-association-badge.is-active .acd-association-indicator {
    background: #65df89;
    box-shadow: 0 0 6px rgba(101, 223, 137, 0.9);
}

/* Disabled state for server selection during loading */
.server-selection-controls.is-loading select {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(30, 30, 30, 0.5);
}

.server-selection-controls select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(30, 30, 30, 0.5);
}

.server-selection-section>label {
    margin-top: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: #ffffff;
    align-self: center;
}

@media (max-width: 767px) {
    .server-selection-row {
        width: min(100%, 720px);
        padding: 0;
    }

    .server-selection-controls {
        flex-wrap: wrap;
    }

    .server-selection-section select {
        width: min(200px, 100%);
    }

}

.user-info-label {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0;
    text-transform: none;
    color: #ffffff;
    margin: 0;
    display: block;
}

/* User info grid */
.user-info-grid {
    display: grid;
    gap: 10px;
    width: 100%;
    flex: 1;
    min-width: 0;
    min-height: 0;
    align-content: flex-start;
}

.user-info-grid>* {
    min-width: 0;
    max-width: 100%;
}

.user-info-row {
    display: grid;
    grid-template-columns: minmax(140px, 42%) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    min-height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(219, 234, 255, 0.14);
    transition: border-color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.user-info-row:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-color: rgba(234, 244, 255, 0.22);
}

.user-info-row--list {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 8px;
}

.user-info-field-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(211, 227, 252, 0.68);
    white-space: nowrap;
    flex-shrink: 0;
}

.user-info-field-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    text-align: left;
    justify-self: start;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.user-info-row--supervisor-split {
    align-items: center;
}

.supervisor-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.supervisor-badges--center {
    justify-content: center;
}

.supervisor-badge {
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    padding: 5px 12px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.supervisor-badge--primary {
    color: #ffffff;
    background: rgba(175, 206, 255, 0.12);
    border: 1px solid rgba(175, 206, 255, 0.3);
}

.supervisor-badge--secondary {
    color: #eaf2ff;
    background: linear-gradient(135deg, rgba(126, 175, 255, 0.25) 0%, rgba(91, 137, 217, 0.15) 100%);
    border: 1px solid rgba(175, 206, 255, 0.35);
}

.supervisor-badge--none {
    color: rgba(211, 227, 252, 0.45);
    font-style: italic;
}

.ext-split-row {
    display: flex;
    gap: 8px;
    min-width: 0;
}

.ext-single-row {
    width: 100%;
    min-width: 0;
}

.ext-single-row .ext-mini-card {
    width: 100%;
    max-width: 100%;
}

.ext-mini-card {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    min-height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(219, 234, 255, 0.14);
    transition: border-color 0.2s ease, background 0.2s ease;
    overflow: hidden;
    box-sizing: border-box;
}

.ext-mini-card:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-color: rgba(234, 244, 255, 0.22);
}

.acd-extension-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ext-badge {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(175, 206, 255, 0.12);
    border: 1px solid rgba(175, 206, 255, 0.3);
    border-radius: 999px;
    padding: 5px 12px;
    letter-spacing: 0.04em;
}

@media (max-width: 767px) {
    .resource-section {
        width: 100%;
    }

    .user-info-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .user-info-field-value {
        justify-self: start;
        text-align: left;
        font-size: 16px;
    }
}

/* Message container */
.message-container {
    padding: 10px 15px;
    font-size: 25px;
    font-weight: bold;
    text-align: center;
    border-radius: 8px;
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    max-width: 520px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: none;
    transition: opacity 0.3s ease;
    backface-visibility: hidden;
    perspective: 1000;
    animation: fadeInOut 3s ease;
    animation-fill-mode: forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    15%,
    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
}

.message-container button {
    color: inherit;
    font-weight: bold;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

.message-container button:hover {
    color: darkred;
}

.message-success {
    background-color: #007a00;
    color: white;
    border: 2px solid #005a00;
}

.message-error {
    background-color: #c00000;
    color: white;
    border: 2px solid #900000;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-left: 15px;
    cursor: pointer;
    padding: 0 5px;
    vertical-align: middle;
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: scale(1.2);
}

.message-container.show {
    display: block;
    opacity: 1;
}

/* Header action buttons */
.header-actions {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-button,
.header-link-button {
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
    border: #fff solid;
    border-radius: 5px;
    background: transparent;
}

.header-actions .acd-association-status+.logout-button {
    margin-left: 22px;
}

.logout-button:hover,
.header-link-button:hover {
    background-color: #d32f2f;
}

.logout-button:active,
.header-link-button:active {
    background-color: #b71c1c;
}

@media (max-width: 767px) {
    .header-actions {
        justify-content: center;
        padding-right: 0;
        padding-top: 8px;
        flex-wrap: wrap;
    }

    .logout-button,
    .header-link-button {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* Login container styles */
.login-container {
    margin: 0 auto;
    position: relative;
    top: 20%;
    max-width: 400px;
    background: #1A2C5B;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

/* Enhanced theme consistency styles */
.page-title {
    color: white;
    text-align: center;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.section-card {
    background: #1A2C5B;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Status indicators */
.status-indicator-success {
    color: #00c400;
    font-size: 24px;
    display: inline-block;
}

.status-indicator-error {
    color: #ff4444;
    font-size: 24px;
    display: inline-block;
}

/* Consistent card styling */
.info-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.info-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* User input container */
.user-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.user-input-container input {
    flex: 1;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

/* Table and inline containers for alignment */
.checkbox-group,
.radio-group,
.inline-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline {
    display: inline-block;
    margin-right: 20px;
}

.line-section {
    border-top: 1px solid #ccc;
    margin-top: 10px;
    padding-top: 10px;
}

.columns {
    display: flex;
    gap: 20px;
}

.column {
    flex: 1;
}

/* UC Profile Dropdown Styles */
.uc-profile-dropdown {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    letter-spacing: 0.01em !important;
    line-height: 1 !important;
    padding: 6px 28px 6px 10px !important;
    border: 1px solid rgba(175, 206, 255, 0.35) !important;
    border-radius: 8px !important;
    background: #1a2c5b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 7px center / 9px 6px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    width: auto;
    height: auto;
    min-height: 36px;
    margin: 0 !important;
}

.uc-profile-dropdown:hover:not(:disabled) {
    border-color: rgba(175, 206, 255, 0.55) !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.25) 100%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 7px center / 9px 6px !important;
}

.uc-profile-dropdown:focus {
    outline: none !important;
    border-color: rgba(175, 206, 255, 0.75) !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
}

.uc-profile-dropdown option {
    background-color: #0d1b33 !important;
    color: #ffffff !important;
    padding: 8px 12px !important;
    text-align: center !important;
}

.uc-profile-dropdown:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary + ACD extensions on one row */
.user-info-row--split {
    grid-template-columns: minmax(80px, 22%) 1fr minmax(70px, 20%) 1fr;
}

/* ACD extension cell — holds value + optional enroll button in a row */
.acd-extension-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

/* ACD enrollment needed status (non-interactive for beta) */
.acd-enrollment-needed {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border: 1px solid rgba(255, 180, 50, 0.55);
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(200, 120, 0, 0.35) 0%, rgba(180, 80, 0, 0.2) 100%);
    color: #ffd580;
    white-space: nowrap;
    flex-shrink: 0;
}

/* External Mask row — label on its own line, controls fill the row below */
.user-info-row--mask {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 8px;
}

.external-mask-controls {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.external-mask-readonly-row {
    display: grid;
    grid-template-columns: minmax(90px, 22%) 1fr;
    align-items: center;
    gap: 10px;
}

.external-mask-readonly-values {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

#external-mask-device-select {
    width: 180px !important;
    min-width: 0;
}

#current-external-mask {
    min-width: 130px;
}

/* Shared dropdown style for mask selects — must override global select{height:380px} */
.mask-dropdown {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    padding: 6px 28px 6px 10px !important;
    border: 1px solid rgba(175, 206, 255, 0.35) !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    height: auto !important;
    width: auto !important;
    min-width: 0;
    max-width: 100%;
    min-height: 36px;
    margin: 0 !important;
    text-align: left !important;
    text-align-last: left !important;
}

#mask-device-select {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    font-family: Consolas, "Courier New", monospace !important;
    letter-spacing: 0 !important;
    white-space: pre !important;
}

#mask-device-select option {
    font-family: Consolas, "Courier New", monospace !important;
    white-space: pre !important;
    text-align: left !important;
}

#mask-value-select {
    width: 100% !important;
}

@media (max-width: 1200px) {
    .external-mask-controls {
        grid-template-columns: 1fr;
    }

    .external-mask-readonly-row {
        grid-template-columns: 1fr;
    }

    .external-mask-readonly-values {
        align-items: stretch;
        flex-direction: column;
    }

    #mask-device-select,
    #mask-value-select,
    #external-mask-device-select,
    .save-mask-button {
        width: 100% !important;
    }
}

.mask-dropdown:hover:not(:disabled) {
    border-color: rgba(175, 206, 255, 0.55) !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
}

.mask-dropdown:focus {
    outline: none !important;
    border-color: rgba(175, 206, 255, 0.75) !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
}

.mask-dropdown option {
    background-color: #0d1b33 !important;
    color: #ffffff !important;
    text-align: left !important;
}

.mask-dropdown:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mask uses shared update button style for consistency */

/* Loading overlay and Pac-Man animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 6, 6, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10000;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.22s ease;
}

.loading-overlay.hidden {
    display: none;
}

.loading-overlay.is-hiding {
    opacity: 0;
    pointer-events: none;
}

.pacman-container {
    width: 140px;
    height: 60px;
    position: relative;
}

.pacman {
    width: 52px;
    height: 52px;
    position: relative;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.28);
}

.pacman::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 52px;
    height: 26px;
    background: #FFD700;
    border-radius: 52px 52px 0 0;
    transform-origin: 26px 26px;
    animation: pacmanJawTop 0.46s ease-in-out infinite;
}

.pacman::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 52px;
    height: 26px;
    background: #FFD700;
    border-radius: 0 0 52px 52px;
    transform-origin: 26px 0;
    animation: pacmanJawBottom 0.46s ease-in-out infinite;
}

.pacman-container::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 12px;
    width: 6px;
    height: 6px;
    background: #060606;
    border-radius: 50%;
    z-index: 2;
}

.dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #FFD700;
    border-radius: 50%;
    top: 23px;
    left: 64px;
}

.dot-1 {
    animation: pelletMove 1s linear infinite;
}

.dot-2 {
    left: 86px;
    animation: pelletMove 1s linear infinite 0.22s;
}

.dot-3 {
    left: 108px;
    animation: pelletMove 1s linear infinite 0.44s;
}

@keyframes pacmanJawTop {

    0%,
    100% {
        transform: rotate(-32deg);
    }

    50% {
        transform: rotate(0deg);
    }
}

@keyframes pacmanJawBottom {

    0%,
    100% {
        transform: rotate(32deg);
    }

    50% {
        transform: rotate(0deg);
    }
}

@keyframes pelletMove {
    0% {
        opacity: 1;
        transform: translateX(0);
    }

    85% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(-66px);
    }
}

.loading-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.8;
}