/* ===== MODAL OVERLAY ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 18, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 1;
    width: 480px;
    max-width: 100%;
    padding: 24px 28px 24px 28px;
    background: rgba(20, 20, 40, 0.88);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    transform: scale(0.96) translateY(12px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content::-webkit-scrollbar {
    width: 3px;
}
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

/* ===== MODAL HEAD ===== */
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 19px;
    font-weight: 500;
    color: #e8edf5;
    letter-spacing: -0.2px;
}

.modal-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.20);
    margin-top: 2px;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    font-size: 14px;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    transition: 0.2s;
    flex-shrink: 0;
    margin-top: 2px;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

/* ===== SERVERS TOOLBAR ===== */
.servers-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.servers-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.15);
}

.servers-add-btn {
    padding: 4px 16px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 450;
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.06);
    cursor: pointer;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    transition: 0.2s;
    flex-shrink: 0;
}

.servers-add-btn:hover {
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.12);
}

/* ===== SERVERS LIST ===== */
.servers-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.server-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px 9px 14px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    transition: 0.25s;
    gap: 8px;
}

.server-item:hover {
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.06);
}

.server-item.is-active {
    background: rgba(167, 139, 250, 0.04);
    border-color: rgba(167, 139, 250, 0.08);
}

.server-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.server-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.server-item-dot.is-active {
    background: #34d399;
}

.server-item-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.server-item-name {
    font-size: 13px;
    font-weight: 450;
    color: #e8edf5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-item-host {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.20);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-item-port {
    color: rgba(255, 255, 255, 0.08);
}

.server-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.server-item-connect {
    padding: 3px 12px;
    border-radius: 40px;
    font-size: 11.5px;
    font-weight: 450;
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.06);
    text-decoration: none;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    transition: 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.server-item-connect:hover {
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.12);
}

.server-item-badge {
    font-size: 11px;
    font-weight: 450;
    color: #34d399;
    padding: 3px 10px;
    border-radius: 40px;
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.06);
    white-space: nowrap;
}

.server-item-remove {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 6px;
    transition: 0.2s;
    cursor: pointer;
    line-height: 1;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    flex-shrink: 0;
}

.server-item-remove:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.06);
}

/* ===== EMPTY STATE ===== */
.servers-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 28px 20px;
}

.servers-empty-text {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.12);
    margin-bottom: 14px;
}

.servers-empty-btn {
    padding: 8px 24px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 450;
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.06);
    cursor: pointer;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    transition: 0.25s;
}

.servers-empty-btn:hover {
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.12);
}

/* ===== FIELDS (login) ===== */
.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.15);
    margin-bottom: 4px;
    font-weight: 500;
}

.field input,
.field-paste input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 9px 14px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: 0.25s;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.field input::placeholder,
.field-paste input::placeholder {
    color: rgba(255, 255, 255, 0.08);
}

.field input:focus,
.field-paste input:focus {
    border-color: rgba(167, 139, 250, 0.25);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 30px rgba(167, 139, 250, 0.02);
}

.field-paste {
    position: relative;
    display: flex;
    align-items: center;
}

.field-paste input {
    padding-right: 68px;
}

.field-paste input[type="password"] {
    letter-spacing: 1.5px;
    padding-right: 68px;
}

.row {
    display: flex;
    gap: 12px;
}

.row .field {
    flex: 1;
}

.actions-row {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.btn-secondary-modal {
    flex: 1;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 450;
    cursor: pointer;
    transition: 0.25s;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    border: none;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.btn-secondary-modal:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.btn-primary-modal {
    flex: 1;
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 450;
    cursor: pointer;
    transition: 0.25s;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    border: none;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(124, 58, 237, 0.18));
    color: #c4b5fd;
    border: 1px solid rgba(167, 139, 250, 0.06);
}

.btn-primary-modal:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.28), rgba(124, 58, 237, 0.28));
    transform: translateY(-1px);
}

.btn-primary-modal:disabled {
    opacity: 0.30;
    cursor: not-allowed;
    transform: none;
}

.status {
    margin-top: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.12);
    text-align: center;
    min-height: 20px;
    transition: 0.25s;
}

.status.error {
    color: #f87171;
}

.status.success {
    color: #34d399;
}

/* ===== RESPONSIVE MODAL ===== */
@media (max-width: 600px) {
    .modal-content {
        padding: 20px 20px 18px 20px;
        border-radius: 18px;
        width: 95%;
        max-width: 95%;
    }
    .modal-title {
        font-size: 17px;
    }
    .modal-subtitle {
        font-size: 12px;
    }
    .modal-close-btn {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    .server-item {
        padding: 8px 10px 8px 12px;
        gap: 6px;
    }
    .server-item-left {
        gap: 10px;
    }
    .server-item-name {
        font-size: 12.5px;
    }
    .server-item-host {
        font-size: 11px;
    }
    .server-item-dot {
        width: 5px;
        height: 5px;
    }
    .server-item-connect {
        font-size: 10.5px;
        padding: 2px 10px;
    }
    .server-item-badge {
        font-size: 10px;
        padding: 2px 8px;
    }
    .server-item-remove {
        font-size: 12px;
    }
    .servers-add-btn {
        font-size: 11px;
        padding: 3px 14px;
    }
    .servers-count {
        font-size: 11px;
    }
    .servers-empty-text {
        font-size: 12.5px;
    }
    .servers-empty-btn {
        font-size: 12px;
        padding: 7px 20px;
    }
    .field input,
    .field-paste input {
        font-size: 13px;
        padding: 8px 12px;
    }
    .field-paste input {
        padding-right: 60px;
    }
    .field-paste input[type="password"] {
        padding-right: 60px;
    }
    .btn-secondary-modal,
    .btn-primary-modal {
        font-size: 12.5px;
        padding: 8px 16px;
    }
    .row {
        gap: 10px;
    }
}

@media (max-width: 420px) {
    .modal-content {
        padding: 16px 14px 14px 14px;
        border-radius: 14px;
        width: 98%;
        max-width: 98%;
        margin: 0 8px;
    }
    .modal-head {
        margin-bottom: 12px;
    }
    .modal-title {
        font-size: 16px;
    }
    .modal-subtitle {
        font-size: 11px;
    }
    .modal-close-btn {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .server-item {
        padding: 6px 8px 6px 10px;
        gap: 4px;
        border-radius: 10px;
    }
    .server-item-left {
        gap: 8px;
    }
    .server-item-name {
        font-size: 12px;
    }
    .server-item-host {
        font-size: 10px;
    }
    .server-item-dot {
        width: 5px;
        height: 5px;
    }
    .server-item-connect {
        font-size: 10px;
        padding: 2px 8px;
    }
    .server-item-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    .server-item-remove {
        font-size: 11px;
        padding: 1px 4px;
    }
    .server-item-right {
        gap: 4px;
    }
    .servers-toolbar {
        margin-bottom: 10px;
    }
    .servers-add-btn {
        font-size: 10px;
        padding: 3px 12px;
    }
    .servers-count {
        font-size: 10px;
    }
    .servers-empty {
        padding: 20px 12px 16px 12px;
    }
    .servers-empty-text {
        font-size: 12px;
    }
    .servers-empty-btn {
        font-size: 11px;
        padding: 6px 18px;
    }
    .servers-list {
        gap: 4px;
    }
    .field {
        margin-bottom: 10px;
    }
    .field label {
        font-size: 9.5px;
    }
    .field input,
    .field-paste input {
        font-size: 12px;
        padding: 7px 10px;
        border-radius: 8px;
    }
    .field-paste input {
        padding-right: 52px;
    }
    .field-paste input[type="password"] {
        padding-right: 52px;
    }
    .field-paste .paste-btn {
        font-size: 10px;
        padding: 3px 8px;
        right: 4px;
    }
    .btn-secondary-modal,
    .btn-primary-modal {
        font-size: 12px;
        padding: 7px 14px;
        border-radius: 8px;
    }
    .actions-row {
        gap: 8px;
        margin-top: 4px;
        flex-direction: row;
    }
    .row {
        flex-direction: column;
        gap: 0;
    }
    .status {
        font-size: 12px;
        margin-top: 10px;
        min-height: 18px;
    }
}